apollo-tooling icon indicating copy to clipboard operation
apollo-tooling copied to clipboard

Configure the VSCode extension through codegen.yml

Open ppseprus opened this issue 2 years ago • 0 comments

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:

// 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!

ppseprus avatar Aug 27 '21 15:08 ppseprus