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

Mesh seems to be sending unrelated subscription query fields to subgraphs when the sub type is a union #7202

Open
1 of 4 tasks
dpnova opened this issue Jul 3, 2024 · 3 comments

Comments

@dpnova
Copy link
Contributor

dpnova commented Jul 3, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on: CodeSandBox
  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

When creating a merged subscription type that is itself a union, mesh can serve the type fine when the resolvers are defined in additionalResolvers, but when they come from separate subgraph services, it errors out when you make the subscription query. See last line in this image:

image

To Reproduce Steps to reproduce the behavior:

Repro is here

use this query:

subscription {
  sync {
    __typename
    ... on Page {
      name
    }
    ... on User {
      id
    }
  }
}

Expected behavior

I would expect mesh to be able to accept the subscription request the way it does when the resolvers are defined in additionalResolvers

Environment:
All relevant environment is in the codesandbox.

@ardatan
Copy link
Owner

ardatan commented Jul 3, 2024

I think you didn't update the Sandbox link.
Could you check?
Thanks for creating the issue!

@dpnova
Copy link
Contributor Author

dpnova commented Jul 3, 2024

Oh sorry, first time I've used it.. Let me check

edit: ok link updated

@dpnova
Copy link
Contributor Author

dpnova commented Jul 3, 2024

In my local I had added more logging to mesh and the type error seems to happen during the processing for the other subgraph if that makes sense? In my example subscription above I see the error for name while the User part of the query is happening.

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

No branches or pull requests

2 participants