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 running into a schema generation error when setting up postgraphile as a source.
(node:71168) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Configuration is not valid:
data/sources/0/handler/postgraphile/options must be object, data/sources/0/handler/postgraphile/options must be string, data/sources/0/handler/postgraphile/options must match a schema in anyOf
🕸️ - GetMesh: Getting subschemas from source handlers
🕸️ - CRM: Generating the schema
🕸️ - Server: Generating the unified schema...
🕸️ - CRM - PostgreSQL: checking client timeout
🕸️ - CRM - PostgreSQL: connecting new client
(node:71168) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
🕸️ - CRM - PostgreSQL: new client connected
🕸️ - CRM - PostgreSQL: pulse queue
🕸️ - CRM - PostgreSQL: no queued requests
🕸️ - CRM: Failed to generate the schema
Error: A type naming conflict has occurred - two entities have tried to define the same type 'Subscription'.
The first entity was:
Adding table type for table "public"."subscription". You can rename the table's GraphQL type via a 'Smart Comment':
COMMENT ON TABLE "public"."subscription" IS E'@name newNameHere';
The second entity was:
graphile-build built-in (root subscription type)
at Object.addType (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/graphile-build@4.12.2_graphql@16.3.0/node_modules/graphile-build/src/makeNewBuild.js:319:17)
at Object.newWithHooks (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/graphile-build@4.12.2_graphql@16.3.0/node_modules/graphile-build/src/makeNewBuild.js:1019:14)
at hook (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/graphile-build@4.12.2_graphql@16.3.0/node_modules/graphile-build/src/plugins/SubscriptionPlugin.js:48:28)
at SchemaBuilder.applyHooks (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/graphile-build@4.12.2_graphql@16.3.0/node_modules/graphile-build/src/SchemaBuilder.js:411:20)
at Object.newWithHooks (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/graphile-build@4.12.2_graphql@16.3.0/node_modules/graphile-build/src/makeNewBuild.js:369:27)
at SchemaBuilder.buildSchema (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/graphile-build@4.12.2_graphql@16.3.0/node_modules/graphile-build/src/SchemaBuilder.js:494:28)
at PostGraphileHandler.getMeshSource (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/@graphql-mesh+postgraphile@0.20.9_graphql@16.3.0/node_modules/@graphql-mesh/postgraphile/index.js:97:32)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/@graphql-mesh+runtime@0.33.13_graphql@16.3.0/node_modules/@graphql-mesh/runtime/index.js:39:28
🕸️: An error occured while writing the schema file: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/@graphql-mesh+runtime@0.33.13_graphql@16.3.0/node_modules/@graphql-mesh/runtime/index.js:69:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
🕸️: An error occurred while building the artifacts: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/@graphql-mesh+runtime@0.33.13_graphql@16.3.0/node_modules/@graphql-mesh/runtime/index.js:69:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
🕸️ - Server: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/Users/marklyck/colony/graphql-mesh/node_modules/.pnpm/@graphql-mesh+runtime@0.33.13_graphql@16.3.0/node_modules/@graphql-mesh/runtime/index.js:69:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
ELIFECYCLE Command failed with exit code 1.
This happens because there is a table in my database called subscription which causes a conflict with the root "Subscription" type.
I have tried 3 things to solve it. I have tried to transform it with rename
and I have tried to add a postgraphile "magic comment" in there. But unsurprisingly the mesh.yml file does not respect or use the postgraphile magic comments.
It looks to me like these transforms don't take any affect until AFTER the postgraphile schema has been generated, and the actual error is occouring during the postgraphile schema generation.
postgraphile has a clear fix for this, which is their "Smart comments", but I don't see any way to add these Smart comments when using graph mesh.
Is there any way to do that??? If not, there needs to be another way to tell postgraphile to rename this table.
To Reproduce
Create a postgres db with a table named "subscription".
Try to connect graph mesh to that posgres table via the @graphql-mesh/postgraphile package.
see error.
Expected behavior
I would expect there to be a way to tell postgraphile schema generator to rename the table "subscription" to something else to fix the conflict.
But the appendPlugins type only supports JSON or string... So the only way to "add" this it to publish my completely un-reusable plugin on npm and have it be installed that way 🤔 That seems like a pretty big workaround for built in plugin support.
Is there any other way to solve this? E.g. can you reference a plugin by filename?
Update: I figured out it does actually accept a local filepath as a valid string, and it works fine in dev mode.
But it breaks in production :( I created a seperate bug ticket for that issue here: #3886
Sadly for now I had to publish it as a seperate npm moodule and install it via package.json to use it.
I'm not sure if this issue is worth resolving, since there is a workaround by building a custom postgraphile plugin and adding it to appendPlugins. But hopefully the issue with local file paths breaking production build will be resolved 🤞
Describe the bug
I'm running into a schema generation error when setting up postgraphile as a source.
This happens because there is a table in my database called
subscription
which causes a conflict with the root "Subscription" type.I have tried 3 things to solve it. I have tried to transform it with
rename
I have tried to encapsulate it (which I want to do anyway)
and I have tried to add a postgraphile "magic comment" in there. But unsurprisingly the mesh.yml file does not respect or use the postgraphile magic comments.
It looks to me like these transforms don't take any affect until AFTER the postgraphile schema has been generated, and the actual error is occouring during the postgraphile schema generation.
postgraphile has a clear fix for this, which is their "Smart comments", but I don't see any way to add these Smart comments when using graph mesh.
Is there any way to do that??? If not, there needs to be another way to tell postgraphile to rename this table.
To Reproduce
Create a postgres db with a table named "subscription".
Try to connect graph mesh to that posgres table via the
@graphql-mesh/postgraphile
package.see error.
Expected behavior
I would expect there to be a way to tell postgraphile schema generator to rename the table "subscription" to something else to fix the conflict.
Environment:
The text was updated successfully, but these errors were encountered: