apollographql / apollographql/apollo-tooling
CLI doesn't accept a custom config using --config=theConfig.js
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
**Intended outcome:**
I want to run `apollo client:codegen` with a custom config
**Actual outcome:**
I can't. This is what I get
```
apollo client:codegen --config=src/apollo.config.js --target=typescript
⚠️ It looks like there are 0 files associated with this Apollo Project. This may be because you don't have any files yet, or your includes/excludes fields are configured incorrectly, and Apollo can't find your files. For help configuring Apollo projects, see this guide: https://go.apollo.dev/t/config
```
**How to reproduce the issue:**
1. Clone `https://github.com/alejandronanez/apollo-tooling-issue-sample`
2. Run `npm run gen-types:broken` to see the command failing
3. Run `npm run gen-types` to see the same command succeed - the difference is that this command defaults to use `/apollo.config.js` instead of `/src/apollo.config.js`

**Versions**
```
"apollo": "^2.28.3"
```
Contributor guide
Research direction
Start by reproducing the issue with `apollo client:codegen --config=src/apollo.config.js --target=typescript`, comparing it with the working command from `npm run gen-types`. Inspect how the CLI resolves `src/apollo.config.js` versus `/apollo.config.js`; done means the custom config is loaded and code generation finds the project files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100