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
Copy file name to clipboardExpand all lines: website/src/pages/docs/guides/react-vue.mdx
+33-3Lines changed: 33 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -480,13 +480,43 @@ From simple Queries to more advanced Fragments-based ones, GraphQL Code Generato
480
480
481
481
**What's next?**
482
482
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:
484
484
485
485
- syntax highlighting
486
486
- autocomplete suggestions
487
487
- validation against schema
488
-
- snippets
489
-
- go to definition for fragments and input types
488
+
- quick-info on hover
489
+
490
+

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
+
```
490
520
491
521
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.
0 commit comments