-
Notifications
You must be signed in to change notification settings - Fork 354
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 generatein the terminal.Please make sure Mesh package versions under
package.jsonmatches 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
When running yarn run mesh validate for a mesh containing a handler for a JSON schema the validation fails with the following error:
ERROR [source=Hello World] Failed to generate the schema for the source
Validation failed for "schemaWithAnnotations" under ".mesh/sources/Hello World": undefined
To Reproduce
Steps to reproduce the behavior:
- https://codesandbox.io/s/github/ardatan/graphql-mesh/tree/master/examples/hello-world
- Run
yarn run mesh validate
Expected behavior
The validation should be successful.
Additional context
After some additional digging I could trace down the actual error to be thrown by the validate function to be
[ "Directive 'transport' was removed from schema 'Query'" ].
It seems the structural representation of the transport directive differs between the two schemas compared during validation:
oldSchema:
"extensions": {},
"astNode": {
"directives": [
{
"kind": "Directive",
"name": { "kind": "Name", "value": "transport" },
"arguments": [
{
"kind": "Argument",
"name": { "kind": "Name", "value": "subgraph" },
"value": { "kind": "StringValue", "value": "Hello World" }
},
{
"kind": "Argument",
"name": { "kind": "Name", "value": "kind" },
"value": { "kind": "StringValue", "value": "rest" }
}
]
}
]
},
// ...
newSchema:
"extensions": {
"directives": {
"transport": { "subgraph": "Hello World", "kind": "rest" }
}
},
// ...