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

Resolves External Argument Default Mismatch specification doesnt account for all arguments #102

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/Section 4 -- Composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ ERROR
- For each {argumentName} in {argumentNames}
- Let {arguments} be the set of all arguments with the name
{argumentName} from all fields in {fields}.
- Let {defaultValue} be the first default value found in {arguments}.
- Let {defaultValues} be the all default values found in {arguments}.
- Let {externalArguments} be the set of all arguments with the name
{argumentName} from all fields in {externalFields}.
- For each {externalArgument} in {externalArguments}
- The default value of {externalArgument} must be equal to
{defaultValue}.
- The default value of {externalArgument} must be equal to all
{defaultValues}.
Comment on lines +348 to +349
Copy link
Contributor

Choose a reason for hiding this comment

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

Assume defaults:

Schema A: 1
Schema B: 2
Schema C: 3 (external)

Wouldn't this compare:

3 with 1
3 with 2
3 with 3 (redundant)

i.e. External defaults shouldn't be included in defaultValues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

does this change the outcome of the rule?

I more or less try to word the rules as simple as possible.

The actualy implementation of the rule would be completely different anyway i believe.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I'm not sure. Maybe not in this specific case.

If there were more than 1 external argument, it would fail if the default values of 2 or more external arguments didn't match?

Assume defaults:

Schema A: 2
Schema B: 2 (external)
Schema C: 3 (external)

Compares:

2 with 2 (B - A)
2 with 2 (B - B)
2 with 3 (B - C [external - external])

3 with 2 (C - A)
3 with 2 (C - B [external - external])
3 with 3 (C - C)

Also the explanatory text is:

This rule ensures that arguments on fields marked as @external have default
values compatible with the corresponding arguments on fields from other source
schemas where the field is defined (non-@external)

🤷‍♂️


**Explanatory Text**

Expand Down
Loading