question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛: Mutations with @defer only responds with the first part

See original GitHub issue

To clarify, this is happening from a non-federated AS4 instance, not router.

Intended outcome: Using the useMutation hook with a mutation with @defer results in only the first chunk loading.

For example, given a server responding with:


---
content-type: application/json; charset=utf-8

{"hasNext":true,"data":{"makePayment":{"id":"1afa84cc-26a5-4820-a496-33c8366e03cd","__typename":"MakePaymentResult"}}}
---
content-type: application/json; charset=utf-8

{"hasNext":false,"incremental":[{"path":["makePayment"],"data":{"paymentStatus":{"__typename":"PaymentSuccess","id":"2a3a1ddd-81e1-4535-8a9c-e8dc1ce38026","billedAmount":39.854330085558395},"__typename":"MakePaymentResult"}}]}
-----

Only

{"makePayment":{"id":"1afa84cc-26a5-4820-a496-33c8366e03cd","__typename":"MakePaymentResult"}

is reported in the data object.

Actual outcome: Mutations update with the correct data, same as with useQuery which works as expected.

How to reproduce the issue: Example Repo: https://github.com/lleadbet/graphql-galaxy-demo

Versions

  System:
    OS: macOS 12.6
  Binaries:
    Node: 16.16.0 - ~/.volta/tools/image/node/16.16.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.11.0 - ~/.volta/tools/image/node/16.16.0/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Firefox: 106.0.5
    Safari: 16.0
  npmPackages:
    @apollo/client: ^3.7.1 => 3.7.1 

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lleadbetcommented, Nov 14, 2022

To clarify, this is happening from a non-federated AS4 instance, not router

0reactions
alessbellcommented, Nov 14, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mutations in Apollo Client - Apollo GraphQL Docs
To execute a mutation, you first call useMutation within a React component and pass it the mutation you want to execute, like so:...
Read more >
Fixes support for defer in mutations #10368 - GitHub
This PR fixes the behavior of mutations when combined with @defer. ... issues. 🐛 : Mutations with @defer only responds with the first...
Read more >
Mutations - Sanity.io
deferred is the fastest way to write. It bypasses the real time indexing completely, and should be used in cases where you are...
Read more >
BRCA Testing, Prophylactic Mastectomy, and ... - Aetna
A first-, second-, or third-degree blood relative who has a known BRCA1 or BRCA2 mutation, where the results will influence clinical utility (e.g.,...
Read more >
GraphQL Code Libraries, Tools and Services
Mutations : Relay lets you mutate data on the client and server using GraphQL mutations ... First-class hooks API; ⚖️ Tiny bundle: only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found