-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
When using full paths for codegen in a subfolder, the codegen works, but --watch
does not.
Your Example Website or App
https://codesandbox.io/p/sandbox/graphql-code-generator-full-path-watch-pst92d
Steps to Reproduce the Bug or Issue
- Run
yarn start
- Notice the types file has the correct code
- Remove
id
from the user query - Notice the codegen does not notice the change and types file is still selecting
id
Expected behavior
When updating the query, codegen should rerun.
Screenshots or Videos
No response
Platform
- OS: Linux
- NodeJS: 20.12.1
graphql
version: 16.2.0@graphql-codegen/*
version(s):- add: 5.0.3
- cli: 5.0.7
- typescript: 4.1.6
- typescript-operations: 4.6.1
@parcel/watcher
: 2.5.1
Codegen Config File
import { CodegenConfig } from "@graphql-codegen/cli";
import { join } from "path";
const config: CodegenConfig = {
schema: join(__dirname, "schema.graphql"),
documents: join(__dirname, "document.graphql"),
generates: {
[join(__dirname, "types.ts")]: {
plugins: ["typescript", "typescript-operations"],
},
},
};
export default config;
Additional context
We needed to use exact full paths because we are in a monorepo and the graphql linter is run from the top level of the repo and the codegen is run from the subfolder.
It looks like the initial codegen does work, it just doesn't watch properly.
AdamL-95, juanpistol, cortf, syed-dawood, bshawnd and 1 moresyed-dawoodcortf, syed-dawood and Sbethm
Metadata
Metadata
Assignees
Labels
No labels