Code generation broken on 2.12.3
See original GitHub issueTrying 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)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Scala is a Maintenance Nightmare - MungingData
This post explains why it's so hard to maintain Scala projects (binary incombatilbilities, frequent breaking changes, SBT plugins, ...
Read more >Apache Log4j 2
Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements...
Read more >jooq + scala code generation: method createIndex in object ...
When I tried to downgrade to scala 2.12.3, it works fine. Is there any solution to make it work with scala 2.12.4? I...
Read more >com.fasterxml.jackson.core : jackson-databind : 2.12.3
jackson-databind - General data-binding functionality for Jackson: works on core streaming API.
Read more >DocumentFormat.OpenXml 2.12.3 - NuGet
It supports scenarios such as: - High-performance generation of ... OpenXml 2.12.3 ... Searching and replacing content in Word/PowerPoint using regular ...
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 Free
Top 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
I have same issue with that. Seems like it’s broken since
2.11.1
. My generation types script and results with different versions of apollo:2.11.0
:2.11.1 -- 2.12.4
:2.12.5+
:This should be resolved in #1355 (published as
apollo@2.15.0
)Please note the comments in the mentioned PR, as this fix comes with some caveats that we cannot work around, unfortunately. There is a range of
graphql
versions that we cannot support. If your project depends ongraphql
, please make sure your installed version fits within the ranges mentioned in the PR.