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

Adds Input With Missing Required Fields #41

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

PascalSenn
Copy link
Contributor

No description provided.

spec/Section 4 -- Composition.md Outdated Show resolved Hide resolved
spec/Section 4 -- Composition.md Outdated Show resolved Hide resolved
spec/Section 4 -- Composition.md Outdated Show resolved Hide resolved
spec/Section 4 -- Composition.md Outdated Show resolved Hide resolved
spec/Section 4 -- Composition.md Outdated Show resolved Hide resolved
spec/Section 4 -- Composition.md Outdated Show resolved Hide resolved
spec/Section 4 -- Composition.md Show resolved Hide resolved
@michaelstaib
Copy link
Member

# warning

input Input1 {
  field1: String
}

input Input1 {
  field2: String
}

# error

input Input1 {
  field1: String!
}

input Input1 {
  field2: String
}

@PascalSenn PascalSenn changed the title Adds input with differnt fields to composition Adds Input With Missing Required Fields Nov 7, 2024

- Let `{requiredFields}` be the intersection of all required field names across all input objects in `{inputs}`.
- For each `{input}` in `{inputs}`:
- Let `{inputFields}` be the set of all field names in of required fields in `{input}`.
Copy link

Choose a reason for hiding this comment

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

Suggested change
- Let `{inputFields}` be the set of all field names in of required fields in `{input}`.
- Let `{inputFields}` be the set of all field names of required fields in `{input}`.

This rule only checks that the field names are the same, not that the field types are the same.
Field types are checked by the [Input Field Types mergeable](#sec-Input-Field-Types-mergeable) rule.
Input types are merged by intersection, meaning that the merged input type will have all fields that are present in all input types with the same name.
This rule ensures that input object types with the same name across different subgraphs share a consistent set of required fields.
Copy link

Choose a reason for hiding this comment

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

Are we reverting to "subgraph" naming again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants