apollographql / apollographql/apollo-tooling
Extension treats entire TS file as GraphQL document
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description

**Intended outcome:**
To have only jurisdiction over content inside ` gql`` ` tags
**Actual outcome:**
The extension treats TS file as a whole as GraphQL schema. I don't know if it is connected to this issue but also I get errors about **@client** directive not being defined, not being able to query local fields on Query/Mutation and the whole error checking feature is not refreshing even if I fix the problem, for example: when I change in schema **`type`** to **`tye`** it reports it's a syntax error but when I fix it, the editor still complains about the error. Additionally, just after the VSCode launch, no errors are shown in any file as long as I don't make an error in .graphql file.
There should be no conflict with other extension as Apollo GraphQL is the only GraphQL extension I have installed.
**How to reproduce the issue:**
Config:
module.exports = {
client: {
service: 'ForgeServe-Hermes-36d71',
// Files processed by the extension
includes: [
'src/**/*.vue',
'src/**/*.js',
'src/**/*.ts',
'src/**/*.graphql',
],
},
}
**Versions**
v1.18.2
Contributor guide
Research direction
Start with the Apollo GraphQL extension configuration, especially the client.includes entries for .ts and .graphql files, and reproduce the behavior using version v1.18.2. Verify that TypeScript files are parsed only for content inside gql tags, that @client and local-field diagnostics behave correctly, and that errors refresh after edits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100