I’m running the docker standalone version:
docker run -it -p 9000:8080 -p 9080:9080 --rm -v /Users/paul/Share/development/dgraph/data:/dgraph --name dgraph dgraph/standalone:latest
I’m going through the message board tutorial and setting up apollo:
https://dgraph.io/learn/courses/messageboardapp/react/develop/react/graphql-queries/
My codegen.yml:
overwrite: true
schema: "http://localhost:9000/admin/schema"
documents:
- "app/**/*.graphql"
generates:
app/types/graphql.ts:
plugins:
- typescript
app/:
preset: near-operation-file
presetConfig:
baseTypesPath: types/graphql
folder: types
extension: .ts
plugins:
- typescript-operations
- typescript-react-apollo
- named-operations-object
config:
reactApolloVersion: 3
withHOC: false
withHooks: true
withComponent: false
I’ve tried every possible combination of port/endpoint I have found combing the docs, posts and examples.
The error:
✔ Parse configuration
❯ Generate outputs
❯ Generate app/types/graphql.ts
✖ Load GraphQL schemas
→ Failed to load schema
Load GraphQL documents
Generate
❯ Generate to app/ (using EXPERIMENTAL preset "near-operation-file")
✖ Load GraphQL schemas
→ Failed to load schema
Load GraphQL documents
Generate
Found 2 errors
✖ app/
Failed to load schema from http://localhost:9000/admin/schema:
Unexpected token < in JSON at position 0
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
If someone can point me in the direct direction. Would appreciate it.
Thanks