-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
[BUG (wrap)]: applying multiple rename transforms breaks requests #1795
Comments
Hmmm. This requires investigation, as off the top of my head I suppose this should work. However, it seems like you could simply combine the two transforms... Is there a use case you were trying to solve? |
I discovered this issue when working with graphql-mesh. We have the option to apply multiple different types of transforms declaratively in a yaml file, such as adding a prefix and changing the naming convention. However, if I try to apply these two together to the same source then this issue appears. It’s subtle because the schema does get created successfully. It seems like there’s something wrong with how the requests are transformed. |
Sigh, got it, will investigate. If you can intercept the delegated requests and results, that would help |
Thank you! Here's some info that may help. For the graphql-mesh defined by: sources:
- name: container
handler:
graphql:
endpoint: http://localhost:8080
transforms:
- prefix:
includeRootOperations: true
value: prefix1
- prefix:
includeRootOperations: true
value: prefix2 and for the query: {
prefix2prefix1test
} I received the following request to my source server (from the mesh server): {
prefix1test: test
} My source server responded with: {
"prefix1test": "hello, world"
} but my mesh server responded with: {
"error": {
"errors": [
{
"message": "Cannot return null for non-nullable field Query.prefix2prefix1test.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"prefix2prefix1test"
]
}
],
"data": null
}
} Looking at this, it seems like the request actually is getting transformed correctly, but the response transforming |
This code is blowing away aliases, which is causing the problem. |
#1795 and likely additional aliasing issues
The latest changes of #1799 are available as alpha in npm: Quickly update your package.json by running:
Thanks for reporting! |
Thank you @yaacovCR for taking care of this so quickly!! |
Let's keep it open until it gets released |
Sounds good. @ardatan I'll let you close it when you're ready. |
Available in 6.2.0! |
When applying multiple
RenameX
transforms in a row that touch the same node types, the schema transform succeeds, but the request/response transforms seem to break.For example, if I try to do the following,
newSchema
will successfully be created, but the result returned for any query that I make to it is always null.A minimal reproduction for this issue can be found here: https://github.com/jakeblaxon/graphql-tools-1795-reproduction
The text was updated successfully, but these errors were encountered: