Trying to generate typescript typings with the command:
npx apollo client:codegen --includes='./src/**/*.tsx' --addTypename --target=typescript --globalTypesFile='src/typings/globalSchemaTypes.d.ts'
This works fine with apollo@2.12.2 and below but breaks from version 2.12.3 to the current release
the error I get is kinda cryptic:
λ › npx apollo client:codegen --includes='./src/**/*.tsx' --addTypename --target=typescript --globalTypesFile='src/typings/globalSchemaTypes.d.ts'
› Warning: apollo update available from 2.12.3 to 2.12.5.
✔ Loading Apollo Project
✖ Generating query files with 'typescript' target
→ Cannot query field "pokemons" on type "Query"
(node:57356) UnhandledPromiseRejectionWarning: GraphQLError: Cannot query field "pokemons" on type "Query"
at Compiler.compileSelection (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:119:27)
at /Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:106:76
at Array.map (<anonymous>)
at Compiler.compileSelectionSet (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:106:18)
at Compiler.compileOperation (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:86:32)
at Object.compileToIR (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:15:44)
at Object.generate [as default] (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo/lib/generate.js:78:36)
at write (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo/lib/commands/client/codegen.js:67:54)
at GraphQLClientProject._onDiagnostics (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo/lib/commands/client/codegen.js:84:29)
at GraphQLClientProject.validate (/Users/fede/Celerative/metrics/packages/metrics-front/node_modules/apollo-language-server/lib/project/client.js:132:18)
(node:57356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:57356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
GraphQLError: Cannot query field "pokemons" on type "Query"
at Compiler.compileSelection (~/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:119:27)
at ~/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:106:76
at Array.map (<anonymous>)
at Compiler.compileSelectionSet (~/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:106:18)
at Compiler.compileOperation (~/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:86:32)
at Object.compileToIR (~/Celerative/metrics/packages/metrics-front/node_modules/apollo-codegen-core/lib/compiler/index.js:15:44)
at Object.generate [as default] (~/Celerative/metrics/packages/metrics-front/node_modules/apollo/lib/generate.js:78:36)
at write (~/Celerative/metrics/packages/metrics-front/node_modules/apollo/lib/commands/client/codegen.js:67:54)
at Task.task (~/Celerative/metrics/packages/metrics-front/node_modules/apollo/lib/commands/client/codegen.js:86:46)
another interesting detail: if I don't have apollo installed and run the command above it will work fine, but using the latest release (npx will download it on the fly)
Trying to generate typescript typings with the command:
npx apollo client:codegen --includes='./src/**/*.tsx' --addTypename --target=typescript --globalTypesFile='src/typings/globalSchemaTypes.d.ts'This works fine with apollo@2.12.2 and below but breaks from version 2.12.3 to the current release
the error I get is kinda cryptic:
another interesting detail: if I don't have apollo installed and run the command above it will work fine, but using the latest release (npx will download it on the fly)