Failed to use Postgraphile as a graphql datasource
See original GitHub issueBug description
an error occurred and the code could not be generated
only working with option --skip-plugins graphile-build:NodePlugin
How to reproduce
run postgrapgphile
postgraphile -c 'postgres://storeo:storeo@localhost:5433/storeo' --watch --enhance-graphiql --dynamic-json
setup datasource wundergraph.config.ts
const postgraphile = introspect.graphql({
apiNamespace: 'pg',
url: 'http://localhost:5000/graphql'
})
const myApplication = new Application({
name: 'app',
apis: [
postgraphile
],
});
run wunderctl
wunderctl generate --env .env
error
2:58:38 PM: wundergraph.app.schema.graphql updated
Error: Interface field pg_Node.nodeId expected but Query does not provide it.
at assertValidSchema (/home/minhdtb/projects/storeo/storeo-backend/node_modules/graphql/type/validate.js:59:11)
at validate (/home/minhdtb/projects/storeo/storeo-backend/node_modules/graphql/validation/validate.js:63:35)
at Object.enter (/home/minhdtb/projects/storeo/storeo-backend/node_modules/@wundergraph/sdk/dist/graphql/operations.js:47:59)
at visit (/home/minhdtb/projects/storeo/storeo-backend/node_modules/graphql/language/visitor.js:197:21)
at parseOperations (/home/minhdtb/projects/storeo/storeo-backend/node_modules/@wundergraph/sdk/dist/graphql/operations.js:30:29)
at /home/minhdtb/projects/storeo/storeo-backend/node_modules/@wundergraph/sdk/dist/configure/index.js:350:61
at processTicksAndRejections (node:internal/process/task_queues:96:5)
--->
No Operations found! Please create at least one Operation in the directory ./operations
Operation files must have the file extension '.graphql', otherwise they are ignored.
Operations don't need to be named, the file name is responsible for the operation name.
<---
Expected behavior
working as expected
WunderGraph information
N/A
Environment & setup
OS: Ubuntu Go version: go1.17.2 linux/amd64 Database: PostgreSQL Node.js version: v16.15.1
WunderCtl Version
Version: 0.90.32
Commit: 386a3d4b66204411dc89da6919aad0bebe524657
Date: 2022-06-06T12:21:43Z
BuiltBy: ci
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Five Common Problems in GraphQL Apps (And How to Fix ...
Solution: GraphQL Schema Generation. A number of solutions to this problem have emerged in the GraphQL ecosystem. For example, PostGraphile ...
Read more >GraphQL API: Integration with PostGraphile [Full-stack Tutorial ...
Using PostGraphile to Integrate with GraphQL; GraphQL Playground; GraphQL API ... “Failed to setup watch fixtures in Postgres database” ...
Read more >PostgreSQL / PostGraphile – GraphQL Mesh
This handler allows you to use the GraphQL schema created by ... out our example that uses schema stitching with a PostgreSQL data...
Read more >Creating an authenticated GraphQL API with PostGraphile
Overview In this blog post we will look at how to create a GraphQL API over our PostgreSQL database and how to secure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s great feedback. I think it makes sense to add this feature to all data sources.
@jensneuse I want to use custom query feature of postgraphile by using plpgsql function. So I used postgraphile as a datasource. Currently, if postgraphile’s custom query returns a JSON data type, wundergraph won’t get it. According to the document here url, I see that replaceJSONTypeFields only support db datasource, I think this feature is needed for graphql datasource as well