When trying to export an endpoint that has no mutations, graphql-tools crashes while trying to parse and create the schema.
For example a DB using postgraphile that is exporting not tables, only a view.
To reproduce the bug:
- Create a postgres db with some tables.
- Create a postgres view.
- Omit all the tables using "@omit read,update,create,delete,all,many" (https://www.graphile.org/postgraphile/smart-tags/#the--character)
- Run graphql-tools
I am using graphql-mesh and it crashes when graphql-tools is trying to create the schema:
`
start
graphql-mesh serve
🕸️ => ⠋ Generating Mesh schema...GraphQL Mesh Configuration is not valid:
data/sources/0/handler/postgraphile must NOT have additional properties
🕸️ => ✖ Unable to start GraphQL Mesh: Cannot convert undefined or null to object
`
The expected behaviour should be ignoring the case of having no mutations and parsing only the queries.
Workaround:
Creating a simple table with no data (so you won't be afraid to export it). Don't omit the operations on this table.
When trying to export an endpoint that has no mutations, graphql-tools crashes while trying to parse and create the schema.
For example a DB using postgraphile that is exporting not tables, only a view.
To reproduce the bug:
I am using graphql-mesh and it crashes when graphql-tools is trying to create the schema:
`
🕸️ => ⠋ Generating Mesh schema...GraphQL Mesh Configuration is not valid:
data/sources/0/handler/postgraphile must NOT have additional properties
🕸️ => ✖ Unable to start GraphQL Mesh: Cannot convert undefined or null to object
`
The expected behaviour should be ignoring the case of having no mutations and parsing only the queries.
Workaround:
Creating a simple table with no data (so you won't be afraid to export it). Don't omit the operations on this table.