vscode-graphql autocomplete not working
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.9k
- Avg merge
- 22h 45m
- Merged PRs (30d)
- 70
Description
Hi everyone,
i have a hard time figuring out how to config this extension so autocomplete works for my graphql types and fields.
Of course i went through the readme but neither config did the trick.
My confilg looks like this:
```
module.exports = {
schema: "http://localhost:4667/graphql",
documents: "src/**/*.{graphql,js,ts,jsx,tsx}",
extensions: {
languageService: {
cacheSchemaFileForLookup: true,
enableValidation: false,
},
},
};
```
I have a `src`-folder and the config file is in the root level.
Most of the time the server crashes with:
```
5/6/2022, 4:02:18 PM [1] (pid: 22159) graphql-language-service-usage-logs: invalid/unknown file in graphql config documents entry:
'src/**/*.{graphql,js,ts,jsx,tsx}'
```
When i start the graphql server, the following errors are thrown too:
```
Type "root" already exists in the schema. It cannot also be defined in this type definition.
Field "root.query" already exists in the schema. It cannot also be defined in this type extension.
Field "root.mutation" already exists in the schema. It cannot also be defined in this type extension.
```
**If i remove the `documents`-property** the server starts. But autocomplete does not work at all.
If i hit ctrl-space, this is what I get:

If i type a `S`it looks like this

And my own types are also not recognized at all:

I struggle with this extension since at least a year… I even switched to PHPStorm once (their extension works perfectly but the IDE is missing features)
I guess it shouId not be this hard to get this working.
I really would appreciate it if someone could help me with this.
Thanks in advance and best regards
Daniel
Contributor guide
Assessment
This issue has not been assessed yet.