-
Notifications
You must be signed in to change notification settings - Fork 271
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
Pin the supported defer specification version to 20220824 #1652
Conversation
Fixed to this commit: graphql/graphql-spec@01d7b98 Since the router will ship before the `@defer` specification is done, we add a parameter to the `Accept` and `Content-Type` headers to indicate which specification version is accepted
This comment has been minimized.
This comment has been minimized.
apollo-router/tests/snapshots/integration_tests__defer_query_without_accept.snap
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we return an HTTP 406 with the error case?
|
||
// set the supported `@defer` specification version to https://github.com/graphql/graphql-spec/pull/742/commits/01d7b98f04810c9a9db4c0e53d3c4d54dbf10b82 | ||
pub(crate) const MULTIPART_DEFER_SPEC_PARAMETER: &str = "deferSpec"; | ||
pub(crate) const MULTIPART_DEFER_SPEC_VALUE: &str = "20220824"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub(crate) const MULTIPART_DEFER_SPEC_VALUE: &str = "20220824"; | |
pub(crate) const MULTIPART_DEFER_SPEC_VALUE: &str = "20220822"; |
clients are sending deferSpec=20220822
can we use that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prasek The motivation for picking 20220824
as the value seems justified/warranted since, as noted above, we're pinning to a commit of the specification on August 24th. If we're going to have a deferSpec
that looks like YYYYMMDD
then it should probably match the spec as of that date. I think clients should make the change here even though I realize this is a bit of a moving target at the moment. It should settle down soon.
On the other hand, if we want a bit more flexibility here (there is probably flexibility) perhaps we should choose a deferSpec
that isn't so precisely date-based — like 202208.001
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I feel like the clarified behavior in that defer spec commit referenced above is noteworthy and worth abiding by, but if we agree together that it's not then let's ensure our implementation (on both sides) abides by the specification on the 22nd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changes to the defer specification from August 24th are used in #1640 so that will be the version we use, because we need the clarification on the if
argument default behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. We can communicate that to the client teams. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good 👍
A comment from @glasser in #1656 (comment)
Referring to: router/apollo-router/src/services/supergraph_service.rs Lines 308 to 321 in cf40d8d
|
Co-authored-by: Jesse Rosenberger <[email protected]>
Fix #1546 Fix #1584 Fix #1633 Co-authored-by: Jesse Rosenberger <[email protected]>
if there were other arguments to the multipart/mixed type in the Accept header, an equality test would fail
yes, it is done in c8a009e |
fixed in e3752f3 |
mime.as_ref() | ||
.map(|mime| { | ||
mime.ty == MULTIPART | ||
&& mime.subty == MIXED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW my impression is that this particular library separates out "the thing after the +" so this woudl also match multipart/mixed+foo
which is probably not ideal. I would suggest just doing mime.essence() == multipartmixed
(essence strips parameters)
Fix #1648
Fix #1656
Fix #1659
Pinned to this commit:
graphql/graphql-spec@01d7b98
Since the router will ship before the
@defer
specification is done, weadd a parameter to the
Accept
andContent-Type
headers to indicatewhich specification version is accepted