Skip to content

Codegen in watch mode does not write generated files after changes #1584

@nilshartmann

Description

@nilshartmann

Intended outcome:

  • Run apollo:codegen in watch-mode
  • Change a TypeScript file containing a query definition with gql tag
  • Save file
  • Type definitions for that query are updated and written to the according .ts file

Actual outcome:

After saving a file in VS Code that contains a query defintion with gql , apollo:codegen in watch mode writes Change detected, generating types... to the console but the files are not updated. After restarting apollo:codegen the files are correctly re-written (one time).

Command used to run apollo codegen (as script from package.json)

apollo client:codegen --target=typescript --globalTypesFile=src/global-query-types.ts --watch --outputFlat src/querytypes

Versions
Affected version: 2.19.x, in Version 2.18.3 it is working correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions