-
-
Notifications
You must be signed in to change notification settings - Fork 831
Description
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 (commit)
- 4. A pull request is pending review
Describe the bug
When using WrapFields a larger number of times across multiple handlers, a graphql.visit
invocation gets increasingly slower. I observed that the selection set in the visited document increases in powers of two for some reason. I'm not sure exactly why but after debugging it is a result of this bit in TransformCompositeFields
.
To Reproduce
My implementation is complex (and the issue seems to be a result of that complexity) but because the fix seems harmless I thought I'd report it before trying to reproduce in a minimal example.
Expected behavior
The visit function is not stuck in a loop.
Environment:
- OS:
@graphql-tools/...
:- NodeJS: 16
Additional context