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

Weird subscribeToMore behavior #8180

Open
rafbgarcia opened this issue May 9, 2021 · 0 comments
Open

Weird subscribeToMore behavior #8180

rafbgarcia opened this issue May 9, 2021 · 0 comments
Labels
🔍 investigate Investigate further

Comments

@rafbgarcia
Copy link

I was implementing GraphQL subscriptions in my project, but I couldn't make subscribeToMore rerender the component.

After investigation, I found out that it was because I wasn't selecting the same fields in my subscription that I had selected in my query.

If I select either the same fields or more fields in the subscription, it rerenders just fine.

Intended outcome:

I'm not sure if this is the correct behavior, it seemed weird to me so I wanted to bring it up.

How to reproduce the issue:

I prepared a codesandbox with 3 scenarios, visiting the link below should take you to subscriptions_link.js with the firstScenario running.

I left some comments in there for y'all to play with it, but please let me know if you have questions.

https://codesandbox.io/s/wild-silence-7sl9w?file=/src/graphql/subscription_link.js:145-233

Versions

✗ npx envinfo@latest --preset apollo --clipboard
npx: installed 1 in 0.945s

  System:
    OS: macOS 11.2.3
  Binaries:
    Node: 10.17.0 - ~/.asdf/installs/nodejs/10.17.0/bin/node
    Yarn: 1.13.0 - ~/.asdf/shims/yarn
    npm: 6.11.3 - ~/.asdf/installs/nodejs/10.17.0/bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Firefox: 88.0.1
    Safari: 14.0.3
  npmPackages:
    @apollo/client: ^3.3.16 => 3.3.16
    apollo-fetch: ^0.7.0 => 0.7.0
    apollo-link-core: ^0.5.4 => 0.5.4
@brainkim brainkim self-assigned this Aug 13, 2021
@hwillson hwillson added the 🔍 investigate Investigate further label May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 investigate Investigate further
Projects
None yet
Development

No branches or pull requests

3 participants