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

GraphQL Stitching is losing "extensions" information from sub-schema response #4732

Open
4 tasks
nick-stephen opened this issue Sep 27, 2022 · 1 comment
Open
4 tasks

Comments

@nick-stephen
Copy link

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

Stitching a remote schema loses any "extensions" information in the query response of a sub-schema

A GraphQL query response may have a top-level "extensions" field next to the "errors" and "data" fields:

https://spec.graphql.org/June2018/#sec-Response-Format

This "extensions" section can be used to provide auxilliary information such as profiling information or hints back to callers for performance optimization, or indeed anything else.

This information is lost when stitching in the remote graphql schema into a stitched global schema.

I would expect to be able to provide a merge function for the optional 'extensions' part of the response payload, with a default implementation which would naively merge the map contents.

@Warxcell
Copy link

I was able to track it down to this function, where extensions are lost

export function mergeDataAndErrors(

but I'm not sure how to proceed.

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