Skip to content

apollo codegen:generate doesn't work in npm run-scripts #630

@kunchenguid

Description

@kunchenguid

on osx, running "apollo codegen:generate --target=typescript --addTypename" in terminal works but putting it in package.json scripts and use "npm run" to execute the exact same command will report an error as below:

✖ Generating query files with 'typescript' target
→ Cannot query field "xxx" on type "Query"
GraphQLError: Cannot query field "xxx" on type "Query"
at Compiler.compileSelection (/node_modules/apollo-codegen-core/lib/compiler/index.js:120:27)
at selections.selectionSetNode.selections.map.selectionNode (
/node_modules/apollo-codegen-core/lib/compiler/index.js:106:76)

Metadata

Metadata

Assignees

No one assigned

    Labels

    🥇 good-first-issueIssues that are suitable for first-time contributors.🌹 has-reproduction❤ Has a reproduction in a codesandbox or single minimal repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions