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

Subscription failed since 1.7.9 #465

Closed
Irupt opened this issue Jan 16, 2025 · 14 comments · Fixed by #552
Closed

Subscription failed since 1.7.9 #465

Irupt opened this issue Jan 16, 2025 · 14 comments · Fixed by #552
Assignees
Labels
bug Something isn't working

Comments

@Irupt
Copy link

Irupt commented Jan 16, 2025

Since the latest version, the subscription seems to be causing an issue. I am able to connect to the WS server, but I consistently encounter an error when receiving a subscription response.

[2025-01-16T15:31:19.442Z] ERROR Error: Cannot return null for non-nullable field Mesure.CODE. 2025-01-16 16:31:19 at completeValue (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:434:19) 2025-01-16 16:31:19 at executeField (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:328:25) 2025-01-16 16:31:19 at executeFields (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:270:28) 2025-01-16 16:31:19 at collectAndExecuteSubfields (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:702:23) 2025-01-16 16:31:19 at completeObjectValue (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:692:12) 2025-01-16 16:31:19 at completeValue (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:458:16) 2025-01-16 16:31:19 at completeValue (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:432:27) 2025-01-16 16:31:19 at executeField (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:328:25) 2025-01-16 16:31:19 at executeFields (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:270:28) 2025-01-16 16:31:19 at executeOperation (/usr/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:234:18) { 2025-01-16 16:31:19 path: [ 'surveillance_graphqlpubsub_mesureSub', 'CODE' ], 2025-01-16 16:31:19 locations: [ { line: 8, column: 3 } ], 2025-01-16 16:31:19 extensions: [Object: null prototype] {}

@Irupt
Copy link
Author

Irupt commented Jan 16, 2025

I tried reverting to version 1.7.8, but the issue persists. I assume it’s a dependent library that didn’t adapt well to the changes.

@ardatan
Copy link
Member

ardatan commented Jan 16, 2025

Could you give more details about your setup so we can help you better?
What is the protocol you use to communicate with the gateway?
How is the gateway communicating with the subgraph?
Which server is the subgraph using? (Apollo/Yoga or sth else)

@Irupt
Copy link
Author

Irupt commented Jan 16, 2025

Thank you for this quick response:

What is the protocol you use to communicate with the gateway > websocket

i use nestJs/yoga for my subgraph with WS.

Subscription work fine but not subscription response after pubsub

@Irupt
Copy link
Author

Irupt commented Jan 16, 2025

The major change I can identify is the upgrade to graphql-ws 6.0, which I don't see in version 1.7.9 but is present in the main branch.

@ardatan
Copy link
Member

ardatan commented Jan 16, 2025

The major change I can identify is the upgrade to graphql-ws 6.0, which I don't see in version 1.7.9 but is present in the main branch.

Because we haven't released it yet.
So we can help you better if you provide a failing reproduction preferrable on CodeSandbox.

@Irupt
Copy link
Author

Irupt commented Jan 16, 2025

i try to do it

all work correctly with this

  "dependencies": {
    "@graphql-hive/gateway": "1.7.8",
    "@graphql-mesh/compose-cli": "1.3.2",
    "@graphql-mesh/utils": "0.103.11",
    "@graphql-tools/utils": "10.7.2",
    "@nestjs/common": "10.4.8",
    "@nestjs/config": "3.3.0",
    "@nestjs/core": "10.4.8",
    "@nestjs/microservices": "10.4.8",
    "@nestjs/platform-express": "10.4.8",
    "class-transformer": "0.5.1",
    "class-validator": "0.14.1",
    "express": "4.18.3",
    "graphql": "16.9.0",
    "graphql-ws": "5.16.0",
    "nats": "2.28.2",
    "reflect-metadata": "0.1.14",
    "rxjs": "7.8.1",
    "tslib": "2.8.1",
    "ws": "8.18.0",
    "zod": "3.23.8"
  }

@ardatan
Copy link
Member

ardatan commented Jan 16, 2025

I see but it seems we still need a reproduction to debug by ourselves.

@dotansimha
Copy link
Member

Hi @Irupt , thank you for reporting. As @ardatan mentioned before, we need a minimal reproduction that can help us to reproduce and identify the issue. It can be very minimal.

Also, you mentioned some changes in the versions that caused this change, can you maybe share with us the package.json and the local lockfile you have for both scenarios? (the one that works, and the one that fails)

Thank you!

@Irupt
Copy link
Author

Irupt commented Jan 21, 2025

I just upgraded the Hive version to 1.8.0, and I still have the same error. As soon as I have some time, I'll create a GitHub repository with a test example. In the meantime, I'll stick with 1.7.8.

@enisdenjo
Copy link
Member

Oh so 1.7.8 works? Because you said it doesn't.

@Irupt
Copy link
Author

Irupt commented Jan 21, 2025

I must have expressed myself poorly, excuse my English. Everything works correctly with version 1.7.8, but it doesn't work with 1.7.9 and 1.8.0.

@ardatan
Copy link
Member

ardatan commented Jan 21, 2025

Could you share your package.json and the lockfile at least? Then we can see the exact versions used.

@Irupt
Copy link
Author

Irupt commented Jan 21, 2025

sure, it's a nx monorepo

package.json
package-lock.json

@dotansimha
Copy link
Member

Thanks @Irupt @enisdenjo @ardatan ! The fix is now available in [email protected] 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants