ardatan / ardatan/graphql-tools
GraphQL Stitching is losing "extensions" information from sub-schema response
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 830
- Avg merge
- 10h 59m
- Merged PRs (30d)
- 45
Description
### Issue workflow progress
_Progress of the issue based on the [Contributor Workflow](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md#a-typical-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.
Contributor guide
Research direction
No source files, tests, reproduction, or entry points are identified in the issue. Start by creating the requested GraphQL schema-stitching reproduction and inspect how a sub-schema response is handled; done means the top-level extensions information is preserved or merged in the stitched response, with a failing test demonstrating the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100