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
1. The issue provides a reproduction available on Stackblitz
I could not make the servers connect to eachother on stackblitz but make sure to clone the repository and run npm install on the root folder and again in the graphql-mesh folder.
Please make sure Mesh package versions under package.json matches yours.
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
Using grpc sources that generate the inner schemas with full package segments unified by an underscore, for example: com_example_user_v1_user_UserProto. And, when using the naming convention transform in wrap mode that changes those namings from snake case to camel case, all the requests to a grpc service method that are using variables, and those variables are objects with a nested object inside the variable properties will fail with the reason that the nested property naming provided in camel case, is wrong and it expects the snake case variant.
To Reproduce Steps to reproduce the behavior:
Clone the repository available on this Github Link or on Stackblitz (the current setup doesn't work on Stackblitz. Mesh can't connect to the nodejs server there, so that's why I suggest to clone the repo)
Install the dependencies on both the node.js server and the graphql-mesh directory.
Start the node server by running node index.js in the root folder.
Start graphql-mesh by running npm run dev in the graphql-mesh directory
Go into the playground and make a request using variables like the following:
The request should echo back the input object. But, instead, an error is returned:
{
"errors": [
{
"message": "Variable \"$input\" got invalid value { nestedFieldOne: \"23\", nestedFieldTwo: \"xxx\" } at \"input.nested\"; Field \"nestedFieldOne\" is not defined by type \"com_example_v1_graphql_NestedObject_Input\". Did you mean \"nested_field_one\" or \"nested_field_two\"?"
},
{
"message": "Variable \"$input\" got invalid value { nestedFieldOne: \"23\", nestedFieldTwo: \"xxx\" } at \"input.nested\"; Field \"nestedFieldTwo\" is not defined by type \"com_example_v1_graphql_NestedObject_Input\". Did you mean \"nested_field_two\" or \"nested_field_one\"?"
},
{
"message": "Variable \"$input\" got invalid value { fieldOne: \"a\", fieldTwo: \"b\", nested: { nestedFieldOne: \"23\", nestedFieldTwo: \"xxx\" } }; Field \"fieldOne\" is not defined by type \"com_example_v1_graphql_Request_Input\". Did you mean \"field_one\" or \"field_two\"?"
},
{
"message": "Variable \"$input\" got invalid value { fieldOne: \"a\", fieldTwo: \"b\", nested: { nestedFieldOne: \"23\", nestedFieldTwo: \"xxx\" } }; Field \"fieldTwo\" is not defined by type \"com_example_v1_graphql_Request_Input\". Did you mean \"field_two\" or \"field_one\"?"
}
]
}
Environment:
OS: macOS 13.3.1 (it also happens in our Kubernetes cluster)
The problem seems to happen whenever I use variables with nested fields in them. If there is only one level of nesting in the variables, the request works. I suppose the other transforms that apply regex won't work as well
The text was updated successfully, but these errors were encountered:
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Stackblitz
Describe the bug
Using grpc sources that generate the inner schemas with full package segments unified by an underscore, for example:
com_example_user_v1_user_UserProto
. And, when using the naming convention transform inwrap
mode that changes those namings from snake case to camel case, all the requests to a grpc service method that are using variables, and those variables are objects with a nested object inside the variable properties will fail with the reason that the nested property naming provided in camel case, is wrong and it expects the snake case variant.To Reproduce Steps to reproduce the behavior:
node index.js
in the root folder.npm run dev
in thegraphql-mesh
directoryAnd provide the following variables in the bottom box, next to the Headers tab:
Expected behavior
The request should echo back the input object. But, instead, an error is returned:
Environment:
Additional context
The problem seems to happen whenever I use variables with nested fields in them. If there is only one level of nesting in the variables, the request works. I suppose the other transforms that apply regex won't work as well
The text was updated successfully, but these errors were encountered: