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

Deferred query with no incremental key on incremental chunks stuck on loading #10406

Closed
alessbell opened this issue Jan 4, 2023 · 1 comment · Fixed by #10735
Closed

Deferred query with no incremental key on incremental chunks stuck on loading #10406

alessbell opened this issue Jan 4, 2023 · 1 comment · Fixed by #10735

Comments

@alessbell
Copy link
Member

alessbell commented Jan 4, 2023

With router PR apollographql/router#2184, deferred responses are no longer included in incremental chunks if the path points to an element of the response that was nullified.

This means that a previous response of


--graphql
content-type: application/json

{"data":{"allProducts":[null,null,null]},"errors":[{"message":"Cannot return null for non-nullable field Product.nonNullErrorField.","locations":[{"line":1,"column":53}],"path":["allProducts",0,"nonNullErrorField"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"stacktrace":["Error: Cannot return null for non-nullable field Product.nonNullErrorField.","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:594:13)","    at executeField (/usr/src/app/node_modules/graphql/execution/execute.js:489:19)","    at executeFields (/usr/src/app/node_modules/graphql/execution/execute.js:413:20)","    at completeObjectValue (/usr/src/app/node_modules/graphql/execution/execute.js:914:10)","    at completeAbstractValue (/usr/src/app/node_modules/graphql/execution/execute.js:795:10)","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:624:12)","    at /usr/src/app/node_modules/graphql/execution/execute.js:696:25","    at Function.from (<anonymous>)","    at completeListValue (/usr/src/app/node_modules/graphql/execution/execute.js:676:34)","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:607:12)"]}}},{"message":"Cannot return null for non-nullable field Product.nonNullErrorField.","locations":[{"line":1,"column":53}],"path":["allProducts",1,"nonNullErrorField"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"stacktrace":["Error: Cannot return null for non-nullable field Product.nonNullErrorField.","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:594:13)","    at executeField (/usr/src/app/node_modules/graphql/execution/execute.js:489:19)","    at executeFields (/usr/src/app/node_modules/graphql/execution/execute.js:413:20)","    at completeObjectValue (/usr/src/app/node_modules/graphql/execution/execute.js:914:10)","    at completeAbstractValue (/usr/src/app/node_modules/graphql/execution/execute.js:795:10)","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:624:12)","    at /usr/src/app/node_modules/graphql/execution/execute.js:696:25","    at Function.from (<anonymous>)","    at completeListValue (/usr/src/app/node_modules/graphql/execution/execute.js:676:34)","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:607:12)"]}}},{"message":"Cannot return null for non-nullable field Product.nonNullErrorField.","locations":[{"line":1,"column":53}],"path":["allProducts",2,"nonNullErrorField"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"stacktrace":["Error: Cannot return null for non-nullable field Product.nonNullErrorField.","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:594:13)","    at executeField (/usr/src/app/node_modules/graphql/execution/execute.js:489:19)","    at executeFields (/usr/src/app/node_modules/graphql/execution/execute.js:413:20)","    at completeObjectValue (/usr/src/app/node_modules/graphql/execution/execute.js:914:10)","    at completeAbstractValue (/usr/src/app/node_modules/graphql/execution/execute.js:795:10)","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:624:12)","    at /usr/src/app/node_modules/graphql/execution/execute.js:696:25","    at Function.from (<anonymous>)","    at completeListValue (/usr/src/app/node_modules/graphql/execution/execute.js:676:34)","    at completeValue (/usr/src/app/node_modules/graphql/execution/execute.js:607:12)"]}}}],"hasNext":true}
--graphql
content-type: application/json

{"hasNext":false,"incremental":[{"data":null,"path":["allProducts",0]},{"data":null,"path":["allProducts",1]},{"data":null,"path":["allProducts",2]}]}
--graphql--

now has a final chunk of

{"hasNext":false}

without an incremental array.

The test for non-nullable errors thrown outside deferred fragments is now failing in our E2E test suite when run with router versions >=1.6.0 as the query remains stuck on loading: true.

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant