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

Merge configs created using stitching directives don't respect type rename transforms on the subschema #4289

Open
Tracked by #5201 ...
wlee-guild opened this issue Mar 8, 2022 · 0 comments

Comments

@wlee-guild
Copy link

Describe the bug

When using the stitching directives transformer with a transform that changes the type name the merge configs are created under the old type name rather than the transformed type name. This causes the stitched schema to be unable to resolve data for the renamed types.

To Reproduce
Steps to reproduce the behavior:

I've created a simple reproduction of the issue using the RenameTypes class from the wrap package in a public repository located here.

Expected behavior

I would expect that the merge configs are applied to the transformed type names as the original types won't be present in the wrapped subschema is being delegated to.

Environment:

  • OS: MacOS Big Sur 11.6.3
  • @graphql-tools/schema: 8.3.2,
  • @graphql-tools/stitch: 8.4.4,
  • @graphql-tools/stitching-directives: 2.2.2,
  • @graphql-tools/wrap: 8.4.3,
  • NodeJS: 16.11.1

Additional context

We are able to work around this and get data resolving again by creating a secondary subschema config transformer that moves the merge configs to the new type name. Additionally, manually specifying a merge config for the renamed type as you would for a schema extension also causes the stitched schema to resolve properly, but this doesn't scale well if you have a large number of renamed types.

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

1 participant