-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
deferred fragments on Query produces undefined
key in data response
#3122
Comments
undefined
key
undefined
keyundefined
key in data response
Hey, I quickly looked into your issue and found a solution from our side, however I am not entirely sure yet on whether we want to support the full breadth of this issue as it seems unspecified in the spec in the depth of what's allowed. Basically when you do a deferred fragment on a root-type like this then This issue also seems highly specific to |
Thank you for the quick response and hasty fix PR, much appreciated. I understand the concerns where you're coming from here. It's an odd situation here where the server supports defer on the root-type but the spec recommends differently. Ideally I would not be querying the manner stated in this issue but currently need to due to schema stitching not supporting defer yet (deferring on the root type is the workaround). However, since this query is allowed, and urql doesn't parse it correctly, it's a gap in urqls capabilities (imo). |
no need, really ✌️ the linked patch PR will fix this and add the missing deep-clone merging as well, which was missing. The spec wasn't too clear on it being necessary. |
Fixed in |
Describe the bug
Hi, i've been exploring adding the
@defer
directive to our graphql server and believe I've come across an issue withurql
.When deferring on the root
Query
fragment,urql
will respond with anundefined
key in the data response.Versions:
"@graphql-yoga/plugin-defer-stream": "^1.7.1"
"@urql/core": "^4.0.1"
"graphql": "17.0.0-alpha.2"
"urql": "^4.0.0"
Expected behavior
Entire query is resolved and merged together
Actual behavior
Query is split via an
undefined
keyThis was verified by using the
with-defer-stream-directives
example with the following script belowThis is resolved if we do not
@defer
the rootQuery
fragment. E.g.However I'm unable to do so ATM due to lack of schema stitching support (ardatan/graphql-tools#1941)
I believe this to be a bug from the side of
urql
Reproduction
Apologies, found this difficult to setup
Urql version
urql v4.0.0
Validations
The text was updated successfully, but these errors were encountered: