You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to write a test in the repo but did not succeed with providing the right test-input.
However, with a working client on our actual production code I was able to debug into it and find out where it goes wrong for us:
In wrapConcreteTypes in prepareGatewayDocument.ts, you create new selections and set the type conditions. However, this type gets set to MutationReturnType.
This causes problems later down the line in finalizeSelectionSet where the fields are discarded, as the types do not match (sorry for the ugly screenshot, had to wipe our internal names). I think , there should be the implementing type instead of the second Type, i.e. Bar.
When I comment out the FIELD visitor in wrapConcreteTypes, everything works as expected (well, for our small case).
Hope that helps even if I could not provide a minimum reproducible version.
Expected behavior
Valid attributes should not be discarded
Environment:
@graphql-tools/delegate: 9.0.21
NodeJS: LTS Gallium
The text was updated successfully, but these errors were encountered:
I was not able to create a fitting testsetup.
Creating a test which uses finalizeGatewayRequest as entrypoint was easy (see trying_to_test.patch), but the problem resides in prepareGatewayDocument.ts. Searching for a test-entry, I found the transforms.test.ts where I tried to hook into (see trying_to_test,_pt_2.patch). There, however I would have create a delegation context which I was not able to.
The tests I did in the client project was using gql from apollo-server-express to create the DocumentNode, executing this on a server with a httpLink and observing the request apollo is trying to send.
Hi, we have a graphql API with the following structure
Describe the bug
When using the mutation with a Fragment on Query, fields of the Interface are removed when used on top level. I.e.
gets transformed to
This does not happen when either the Fragment is not on top level or the Interface is nested. I.e. the following work:
To Reproduce
Steps to reproduce the behavior:
I tried to write a test in the repo but did not succeed with providing the right test-input.
However, with a working client on our actual production code I was able to debug into it and find out where it goes wrong for us:
In
wrapConcreteTypes
inprepareGatewayDocument.ts
, you create new selections and set the type conditions. However, this type gets set toMutationReturnType
.This causes problems later down the line in
finalizeSelectionSet
where the fields are discarded, as the types do not match (sorry for the ugly screenshot, had to wipe our internal names). I think , there should be the implementing type instead of the second Type, i.e.Bar
.When I comment out the
FIELD
visitor inwrapConcreteTypes
, everything works as expected (well, for our small case).Hope that helps even if I could not provide a minimum reproducible version.
Expected behavior
Valid attributes should not be discarded
Environment:
@graphql-tools/delegate
: 9.0.21The text was updated successfully, but these errors were encountered: