Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Force explicit primary decl. in SDL for one-ones #2462

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #2461

Description

Forces the explicit declaration of the primary side of one-one relation fields in SDL.

PatchSchema already forces this and needed no change.

Note: The error usage in the db package may be removed very soon in #2451 along with the entire request/graphql/schema/relations.go file.

@AndrewSisley AndrewSisley added feature New feature or request area/schema Related to the schema system labels Mar 27, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.11 milestone Mar 27, 2024
@AndrewSisley AndrewSisley requested a review from a team March 27, 2024 20:19
@AndrewSisley AndrewSisley self-assigned this Mar 27, 2024
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.12%. Comparing base (a2c3863) to head (178e4dd).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2462      +/-   ##
===========================================
+ Coverage    75.07%   75.12%   +0.04%     
===========================================
  Files          278      278              
  Lines        26945    26940       -5     
===========================================
+ Hits         20228    20236       +8     
+ Misses        5369     5361       -8     
+ Partials      1348     1343       -5     
Flag Coverage Δ
all-tests 75.12% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/errors.go 69.44% <100.00%> (+2.28%) ⬆️
db/collection.go 73.08% <100.00%> (ø)
db/errors.go 64.55% <ø> (-0.58%) ⬇️
request/graphql/schema/relations.go 84.34% <100.00%> (+5.93%) ⬆️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2c3863...178e4dd. Read the comment docs.

@AndrewSisley AndrewSisley changed the title feat: Force explicit primary decl. in SDL for one-ones feature: Force explicit primary decl. in SDL for one-ones Mar 27, 2024
@AndrewSisley AndrewSisley changed the title feature: Force explicit primary decl. in SDL for one-ones feat: Force explicit primary decl. in SDL for one-ones Mar 27, 2024
Copy link
Contributor

@islamaliev islamaliev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but it would be really great to have at least one test that tests new expectation.

@AndrewSisley
Copy link
Contributor Author

Looks good, but it would be really great to have at least one test that tests new expectation.

I woke up this morning realising I had not done that - will add at least one before merge :)

@AndrewSisley AndrewSisley force-pushed the 2461-force-primary-sdl-declaration branch from 2bf7967 to 2fb78db Compare March 28, 2024 15:22
@AndrewSisley AndrewSisley merged commit 34ff648 into sourcenetwork:develop Mar 28, 2024
31 checks passed
@AndrewSisley AndrewSisley deleted the 2461-force-primary-sdl-declaration branch March 28, 2024 15:57
shahzadlone pushed a commit that referenced this pull request Apr 3, 2024
## Relevant issue(s)

Resolves #2461

## Description

Forces the explicit declaration of the primary side of one-one relation
fields in SDL.

PatchSchema already forces this and needed no change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Related to the schema system feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force @primary directive for one-one relations in SDL
2 participants