I'm finding that all glob patterns fail to find matches, while includes values that don't have any patterns are successful.
For example, this finds no matches:
node_modules/.bin/apollo codegen:generate --localSchemaFile=graphql-schema.json --target=typescript --includes=src/client/store/*.ts --tagName=gql --addTypename --globalTypesFile=src/client/types/queries.ts queryTypes
But if I change --includes=src/client/store/*.ts to point to a single file, e.g. --includes=src/client/store/registry.ts, it does work. It doesn't seem to matter if I prepend ./ before the path, or use absolute paths.
I am using v2.15.0.
Ah, needed to put quotes around the glob: --includes='src/client/store/*.ts'
Awesome thanks! It's all about quotes!
I'll add this here since I was lucky to find it accidentally after wading through the source: In next.js, when using parameters in routes, your files will have names such as [id].tsx. If you don't quote the argument to --includes, a glob will be resolved by your shell, and the internal glob logic of apollo-codegen will receive [id].tsx, which it seems is a glob instruction itself, and will then not yield the actual file as a result.
Ah, needed to put quotes around the glob:
--includes='src/client/store/*.ts'
This should really be in the docs...
Most helpful comment
Ah, needed to put quotes around the glob:
--includes='src/client/store/*.ts'