Skip to content

Commit 967a34d

Browse files
JoviDeCroockn1ru4l
andauthored
docs(react-vue): add mention of graphqlsp to the docs (#9773)
Co-authored-by: Laurin Quast <[email protected]>
1 parent 71c92d5 commit 967a34d

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed
57.4 KB
Loading

website/src/pages/docs/guides/react-vue.mdx

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,43 @@ From simple Queries to more advanced Fragments-based ones, GraphQL Code Generato
480480

481481
**What's next?**
482482

483-
To get the best GraphQL development experience, we recommend installing the [GraphQL VSCode extension](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) to get:
483+
To get the best GraphQL development experience, we recommend installing the [GraphQLSP](https://github.com/0no-co/GraphQLSP) package to get:
484484

485485
- syntax highlighting
486486
- autocomplete suggestions
487487
- validation against schema
488-
- snippets
489-
- go to definition for fragments and input types
488+
- quick-info on hover
489+
490+
![GraphQLSP](/assets/docs/graphqlsp.png)
491+
492+
`GraphQLSP`s a TypeScript LSP plugin for GraphQL, to get it working, we need to add the following to your `tsconfig.json`
493+
after installing the package (`npm i -D @0no-co/graphqlsp`):
494+
495+
```json filename="tsconfig.json"
496+
{
497+
"compilerOptions": {
498+
"plugins": [
499+
{
500+
"name": "@0no-co/graphqlsp",
501+
"schema": "./schema.graphql",
502+
"disableTypegen": true,
503+
"templateIsCallExpression": true,
504+
"template": "graphql"
505+
}
506+
]
507+
}
508+
}
509+
```
510+
511+
Last but not least you need to ensure that when you're using `VSCode` that the workspace version of TS is used, the following
512+
config will make a prompt appear to switch it when visiting a TS file
513+
514+
```json filename=".vscode/settings.json"
515+
{
516+
"typescript.tsdk": "node_modules/typescript/lib",
517+
"typescript.enablePromptUseWorkspaceTsdk": true
518+
}
519+
```
490520

491521
Also, make sure to follow GraphQL best practices by using [`graphql-eslint`](https://github.com/B2o5T/graphql-eslint) and the [ESLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to visualize errors and warnings inlined in your code correctly.
492522

0 commit comments

Comments
 (0)