Repository navigation
Validation of @defer/@stream label arguments
#35
robrichard
announced in
Architectural Decision Records
Replies: 4 comments 5 replies
|
3 sounds reasonable to me. If this ends up preventing real use cases, we can always allow it later. |
0 replies
|
This was discussed at the March 2022 WG meeting and we decided to add validation preventing variables in labels, and a validation enforcing uniqueness. Spec and reference implementation PRs have both been updated to reflect this. |
0 replies
|
from @yaacovCR
|
2 replies
|
Sorry to come back to this topic again! A question arose while implementing this validation: is "document" meant to mean the whole document across multiple operations? For instance, this would mean the following is invalid: query Query1 {
field {
...fieldDetails1 @defer(label: "details")
}
}
query Query2 {
field {
...fieldDetails2 @defer(label: "details")
}
}even though this can never cause any ambiguity? |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Context
raised by @BoD graphql/graphql-spec#742 (comment)
The
labelargument on@deferand@streamis used by GraphQL clients to identify the data from patch responses and associate it with the correct fragment. If provided, the GraphQL Server must add it to the payload.Validating this argument runs into the same issue that was discussed in @stream initialCount validation; the validation stage can happen before variables are known.
Three options considered:
Decision
Discussed at the March 2022 WG meeting and decided to add validation preventing variables in labels, and a validation enforcing uniqueness.
There haven't been any use cases raised that require variables for label values. This could be loosened later without breaking backwards compatibility if additional use cases are discovered.
Status
All reactions