Skip to content

Rowadz/potential-schema-stitching-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To fix this!

use batch: true even to your main and subschemas (this will give you back aliases but not the one passed from the client)

-> ardatan/graphql-tools#6329 (comment)


$ git clone git@github.com:Rowadz/potential-schema-stitching-bug.git
$ cd potential-schema-stitching-bug
$ npm i
# I'm using node 18
$ npm run dev

When running the following query I would suspect that the info.path.key property in each resolver to be userAlias01 and userAlias02 but it's not, it's only user

This only happens in the first level resolvers

query users {
  userAlias01: user(id: 1) {
    id
    name
  }
  userAlias02: user(id: 2) {
    id
    name
  }
}

launch.json file if you use vscode

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Run server",
      "program": "${workspaceFolder}/node_modules/nodemon/bin/nodemon",
      "args": ["src/index.ts"],
      "env": {
        "TRANSPILE_ONLY": "1"
      },
      "internalConsoleOptions": "openOnSessionStart",
      "skipFiles": ["<node_internals>/**"]
    }
  ]
}

About

A potential bug in the stitchingSchema function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published