You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a generated schema file, schema.graphql. The file is generated by merging definitions from gql tags throughout our typescript backend.
We would like to get intellisense, autocomplete, etc. within those gql tags in our typescript backend files. In order to do that, it seems like we must include those files in our apollo.config.js via the includes key. But if we do this, the language server repeatedly crashes with a ton of errors along these lines: Type "XXX" already exists in the schema. It cannot also be defined.... For reference, here is our config, roughly:
module.exports={client: {service: {name: "service-name",localSchemaFile: "./generated/schema.graphql",},includes: ["./src/client/**/*.{ts,tsx,js,jsx}",// If we include these server files, everything breaks"./src/server/**/*.{ts,tsx,js,jsx}"],excludes: ["**/*tests.{ts,tsx,js,jsx}","*.graphql",],},};
Ideally we would either 1) have the schema parsed from our ts files without loading the generated schema, or 2) be able to use intellisense for our ts files without merging them into the loaded schema.
The text was updated successfully, but these errors were encountered:
addiebarron
changed the title
Cannot enable intellisense for server-side GQL while using localSchemaFile
Cannot use intellisense for server GQL while using generated localSchemaFile
Oct 18, 2023
In your case, I would create two apollo.config.js files in the client and server folder respectively - the extension will detect those and apply different rules to those folders.
We have a generated schema file,
schema.graphql
. The file is generated by merging definitions fromgql
tags throughout our typescript backend.We would like to get intellisense, autocomplete, etc. within those
gql
tags in our typescript backend files. In order to do that, it seems like we must include those files in ourapollo.config.js
via theincludes
key. But if we do this, the language server repeatedly crashes with a ton of errors along these lines:Type "XXX" already exists in the schema. It cannot also be defined...
. For reference, here is our config, roughly:Ideally we would either 1) have the schema parsed from our
ts
files without loading the generated schema, or 2) be able to use intellisense for ourts
files without merging them into the loaded schema.The text was updated successfully, but these errors were encountered: