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
Describe the bug
I'm trying to proxy two GraphQL services, and I would like to "namespace" one of them, by encapsulating all of that graph within backoffice { ... }. My configuration is a follows
When I run DEBUG=1 mesh dev I get no errors, and everything runs fine with the GraphQL playground opening up in my browser. The backoffice source is not encapsulated as expected though
Running DEBUG=1 yarn run mesh build --throwOnInvalidConfig=true gives
💡 🕸️ Mesh Cleaning existing artifacts
💡 🕸️ Mesh Reading the configuration
💡 🕸️ Mesh Generating the unified schema
🐛 🕸️ Mesh - GetMesh Getting subschemas from source handlers
🐛 🕸️ Mesh - frontoffice Generating the schema
🐛 🕸️ Mesh - backoffice Generating the schema
🐛 🕸️ Mesh - backoffice The schema has been generated successfully
🐛 🕸️ Mesh - backoffice Analyzing transforms
🐛 🕸️ Mesh - frontoffice The schema has been generated successfully
🐛 🕸️ Mesh - frontoffice Analyzing transforms
🐛 🕸️ Mesh - GetMesh Schemas have been generated by the source handlers
🐛 🕸️ Mesh - GetMesh Merging schemas using the defined merging strategy.
🐛 🕸️ Mesh - stitchingMerger Stitching directives are being generated
🐛 🕸️ Mesh - stitchingMerger Checking if any of sources has federation metadata
🐛 🕸️ Mesh - stitchingMerger Stitching the source schemas
🐛 🕸️ Mesh - stitchingMerger sourceMap is being generated and attached to the unified schema
Transformed schema is not set yet. Returning a dummy one.
💡 🕸️ Mesh Generating artifacts
💡 🕸️ Mesh Generating index file in TypeScript
💡 🕸️ Mesh Writing index.ts for ESM to the disk.
💡 🕸️ Mesh Writing index.ts for CJS to the disk.
💡 🕸️ Mesh Cleanup
💡 🕸️ Mesh Done! => /Users/lassenorregaard/Source/mesh-gateway-poc/.mesh
✨ Done in 2.36s.
and running DEBUG=1 yarn run mesh validate gives
💡 🕸️ Mesh Reading the configuration
💡 🕸️ Mesh Generating the unified schema
🐛 🕸️ Mesh - GetMesh Getting subschemas from source handlers
🐛 🕸️ Mesh - frontoffice Generating the schema
🐛 🕸️ Mesh - backoffice Generating the schema
💥 🕸️ Mesh - backoffice Failed to generate the schema Error: Failed to fetch introspection from https://url-2/graphql: ValidationError: Validation failed for "introspectionSchema" under ".mesh/sources/backoffice": undefined
at doValidation (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/store/cjs/index.js:155:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.set (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/store/cjs/index.js:182:21)
at async Object.getWithSet (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/store/cjs/index.js:168:25)
at GraphQLHandler.getMeshSource (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/graphql/cjs/index.js:302:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:132:28
💥 🕸️ Mesh - frontoffice Failed to generate the schema Error: Failed to fetch introspection from https://url-1/graphql: ValidationError: Validation failed for "introspectionSchema" under ".mesh/sources/frontoffice":
at doValidation (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/store/cjs/index.js:155:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.set (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/store/cjs/index.js:182:21)
at async Object.getWithSet (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/store/cjs/index.js:168:25)
at GraphQLHandler.getMeshSource (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/graphql/cjs/index.js:302:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:132:28
💥 🕸️ Mesh Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh.
at getMesh (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:166:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.handler (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/cli/cjs/index.js:233:26)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
To Reproduce
Steps to reproduce the behavior:
I tried to create a reproduction here but that just works. I can see the publicly available GraphQL API I've chosen for the reproduction supports federation.
The actual APIs I'm trying to proxy do not support federation.
Expected behavior
The backoffice source would be nested under backoffice { ... } in the graph.
Environment:
OS: MacOS 13.0.1
@graphql-mesh/cli: 0.82.3
@graphql-mesh/graphql: 0.33.3
@graphql-mesh/transform-encapsulate: 0.4.3
NodeJS: v16.15.1
Additional context
If I add the SDL from each of the services as a file using the source configuration of the graphql sources, like this
💡 🕸️ Mesh Cleaning existing artifacts
💡 🕸️ Mesh Reading the configuration
💡 🕸️ Mesh Generating the unified schema
🐛 🕸️ Mesh - GetMesh Getting subschemas from source handlers
🐛 🕸️ Mesh - frontoffice Generating the schema
🐛 🕸️ Mesh - frontoffice Reading schema.graphql from the file system
🐛 🕸️ Mesh - backoffice Generating the schema
🐛 🕸️ Mesh - backoffice Reading schema-backoffice.graphql from the file system
🐛 🕸️ Mesh - backoffice The schema has been generated successfully
🐛 🕸️ Mesh - backoffice Analyzing transforms
💥 🕸️ Mesh - frontoffice Failed to generate the schema Error: Failed to fetch introspection from https://url-1/graphql: Error: Unknown type "Long". Did you mean "Link"?
Unknown type "Long". Did you mean "Link"?
Unknown type "Long". Did you mean "Link"?
at assertValidSDL (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/graphql/validation/validate.js:135:11)
at buildASTSchema (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/graphql/utilities/buildASTSchema.js:44:34)
at buildSchema (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/graphql/utilities/buildASTSchema.js:109:10)
at GraphQLHandler.getNonExecutableSchemaForHTTPSource (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/graphql/cjs/index.js:87:50)
at GraphQLHandler.getMeshSource (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/graphql/cjs/index.js:302:23)
at async /Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:132:28
💥 🕸️ Mesh Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh.
at getMesh (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:166:15)
at async Object.handler (/Users/lassenorregaard/Source/mesh-gateway-poc/node_modules/@graphql-mesh/cli/cjs/index.js:304:53)
error Command failed with exit code 1.
We do have Long in our SDL which is not defined as a scalar. Is it possible to run the gateway in a less strict mode? I mean the GraphQL playground is running fine, and all of our clients (using Apollo) are not blocked by this 🤔
The text was updated successfully, but these errors were encountered:
I'm not able to run the sandbox you sent. Could you update it if the issue persists?
I'm closing the issue for now. We can reopen it if the issue persists and you update the sandbox. Thanks!
We do have Long in our SDL which is not defined as a scalar. Is it possible to run the gateway in a less strict mode? I mean the GraphQL playground is running fine, and all of our clients (using Apollo) are not blocked by this
I don't think we can do that because this will cause an inconsistent behavior.
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
I'm trying to proxy two GraphQL services, and I would like to "namespace" one of them, by encapsulating all of that graph within
backoffice { ... }
. My configuration is a followsWhen I run
DEBUG=1 mesh dev
I get no errors, and everything runs fine with the GraphQL playground opening up in my browser. Thebackoffice
source is not encapsulated as expected thoughRunning
DEBUG=1 yarn run mesh build --throwOnInvalidConfig=true
givesand running
DEBUG=1 yarn run mesh validate
givesTo Reproduce
Steps to reproduce the behavior:
I tried to create a reproduction here but that just works. I can see the publicly available GraphQL API I've chosen for the reproduction supports federation.
The actual APIs I'm trying to proxy do not support federation.
Expected behavior
The backoffice source would be nested under
backoffice { ... }
in the graph.Environment:
@graphql-mesh/cli
: 0.82.3@graphql-mesh/graphql
: 0.33.3@graphql-mesh/transform-encapsulate
: 0.4.3Additional context
If I add the SDL from each of the services as a file using the
source
configuration of the graphql sources, like thisthen
mesh build
givesWe do have
Long
in our SDL which is not defined as a scalar. Is it possible to run the gateway in a less strict mode? I mean the GraphQL playground is running fine, and all of our clients (using Apollo) are not blocked by this 🤔The text was updated successfully, but these errors were encountered: