dotansimha / graphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
https://the-guild.dev/graphql/codegen/
MIT License
10.81k stars 1.32k forks source link

fix: nullable filepath config #10093

Open MatthewMaclean opened 1 month ago

MatthewMaclean commented 1 month ago

Description

Filepath is an optionally provided param that is unnecessarily mandatory when the CLI is set to watch mode. This change reflects that in the typing and it's usage when setting watch patterns. This has been a problem since 4.x.

Related # (issue) See https://github.com/dotansimha/graphql-code-generator/issues/9490

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Not sure the easiest way to go about testing this locally. If I modify the node_module code to drop this reference to filepath, it works as expected.

Checklist:

Further comments

I'm open to alternatives here. I also wonder if the process.cwd() that's used when filepath is provided should instead use the context's cwd. It's confusing to provide a param to override to cwd but then have it ignored. That change would definitely be breaking though, so I'm not inclined to lump it into this PR.

changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: 95c26713810421ffdc216d73ba963e74a385224e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR