apollographql / apollographql/apollo-tooling

Configure the VSCode extension through codegen.yml

Open
#2,429 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

Im working on a repository, where there are duplicate definitions (though the GraphQL Playground does not have any issues), therefore, using the `includes` and `excludes` in the `apollo.config.js` is hardly possible, or easy.

I was wondering, if it was possible to simply include the `codegen.yml` instead. So, I gave it a try and it seems like the extension finds the types:

```js
// apollo.config.js

module.exports = {
client: {
includes: ['codegen.yml'],
service: {
name: 'my-project',
url: 'http://localhost:3000/graphql',
},
},
}
```

```
// Output

------------------------------
🚀 Apollo GraphQL v1.19.4
------------------------------
✅ Service Loaded!
🆔 Service ID: my-project
🏷 Schema Tag: current
📈 Number of Types: 64 (0 client types)
------------------------------
```

For some reason though, validation and autocomplete do not work.

Am I doing something wrong here? Is it possible even to use the `codegen.yml` like that?
Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with the apollo.config.js example and codegen.yml behavior described in the issue, then trace how the VSCode extension loads included files. Determine whether codegen.yml is supported for validation and autocomplete, and make the behavior consistent with the documented configuration or clearly report the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript, vscode, yaml
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.