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

Getting an Error for Invalid Subscription Requests #2534

Closed
Nuvindu opened this issue Jul 4, 2022 · 8 comments · Fixed by #2535
Closed

Getting an Error for Invalid Subscription Requests #2534

Nuvindu opened this issue Jul 4, 2022 · 8 comments · Fixed by #2535

Comments

@Nuvindu
Copy link

Nuvindu commented Jul 4, 2022

I'm currently working on integrating GraphQL subscriptions in Ballerina language to a GraphiQL web based client. It uses websockets for subscriptions and works fine with valid subscription requests.
But for invalid subscription requests, an error occurs like this.
image

The GraphiQL client receives this websocket payload.

{"type":"error", "id":"b2dd2712-1ac5-48fa-9f25-8b88d3d80bf0", "payload":{"errors":[{"message":"Cannot query field \"messag\" on type \"MsgType\".", "locations":[{"line":4, "column":5}]}]}}
@Nuvindu
Copy link
Author

Nuvindu commented Jul 4, 2022

I removed errors field in the WebSocket payload and tried again.

{"type":"error", "id":"a2598b2a-ba44-4bee-be9a-40eea8e5cc4e", "payload":[{"message":"Cannot query field \"messag\" on type \"MsgType\".", "locations":[{"line":4, "column":5}]}]}

Then only the message field is correctly shown. But still an error occurrs.
subscription-graphiql-error

In the console, the error is displayed as follows.

lib.ts:128 Uncaught (in promise) Error: Cannot query field "messag" on type "MsgType".
    at Object.error (lib.ts:128:13)
    at Object.a2598b2a-ba44-4bee-be9a-40eea8e5cc4e (graphql-ws.js:526:46)
    at emit (graphql-ws.js:249:98)
    at Object.emit (graphql-ws.js:276:25)
    at o.onmessage (graphql-ws.js:363:33)

@thomasheyenbrock
Copy link
Collaborator

Thanks for reporting @Nuvindu! I thought this would be a regression with the recent refactorings we did, but seems like this has been an issue even before that. I opened a PR that would fix this.

@Nuvindu
Copy link
Author

Nuvindu commented Jul 21, 2022

@thomasheyenbrock Is there any update for this?

@thomasheyenbrock
Copy link
Collaborator

@Nuvindu thanks for following up! I have been busy the last weeks focussing on getting the new design ready, so this fell kinda off the plate 😞 I'll try to follow up this or next week 🤞

@Nuvindu
Copy link
Author

Nuvindu commented Jul 21, 2022

No worries!🙌. I saw the pr is almost completed. That's why I asked.

@thomasheyenbrock
Copy link
Collaborator

This should now be fixed in [email protected]

@DimuthuMadushan

This comment was marked as off-topic.

@thomasheyenbrock

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants