-
We have a couple of independent graphql services build in Elixir and I'm trying to add a client npm package for each of those. I'm using codegen to create a This is my codegen.yml: overwrite: true
schema: "../schemas/public-schema.graphql"
documents: "src/**/*.graphql"
generates:
src/index.tsx:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
config:
withHooks: true
withHOC: false
withComponent: false and {
"scripts": {
"generate": "graphql-codegen --config codegen.yml",
"build": "tsc"
},
"dependencies": {
"graphql": "^15.3.0"
},
"peerDependencies": {
"@apollo/react-common": "^3.1.4",
"@apollo/react-hooks": "^4.0.0"
},
"devDependencies": {
"@apollo/react-common": "^3.1.4",
"@apollo/react-hooks": "^4.0.0",
"@graphql-codegen/cli": "1.17.7",
"@graphql-codegen/introspection": "1.17.7",
"@graphql-codegen/typescript": "1.17.7",
"@graphql-codegen/typescript-operations": "1.17.7",
"@graphql-codegen/typescript-react-apollo": "1.17.7",
"@types/apollo-codegen": "^0.20.3",
"@types/react": "^16.9.44",
"typescript": "^3.9.7"
}
} When running the build with
I'm a bit new to the whole typescript/codegen thingy – can you please advise how to proceed? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Turns out the solution is pretty straightforward – just include |
Beta Was this translation helpful? Give feedback.
Turns out the solution is pretty straightforward – just include
apollo-client
as a devDependency (and as a dependency in the child project).