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
{{ message }}
This repository was archived by the owner on Jul 31, 2022. It is now read-only.
For IntelliJ users and otherwise
We can't enable this by default in the language server because some of the features were intentionally deprecated because of their resource intensiveness. For example, nested config files. `graphqlConfig.loadSchema()` is invoked on most editor operations, so the config is re-fetched frequently.
Copy file name to clipboardExpand all lines: README.md
+27-7Lines changed: 27 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,9 @@ the file needs to be placed at the project root by default, but you can configur
68
68
69
69
Previous versions of this extension support `graphql-config@2` format, which follows [legacy configuration patterns](https://github.com/kamilkisiela/graphql-config/tree/legacy#usage)
70
70
71
-
To support language features like "go-to definition" across multiple files, please include `documents` key in the graphql-config default or /per project (this was `include` in 2.0).
71
+
If you need legacy support for `.graphqlconfig` files or older graphql-config formats, see [this FAQ answer](#legacy). If you are missing legacy `graphql-config` features, please consult [the `graphql-config` repository](https://github.com/kamilkisiela/graphql-config).
72
+
73
+
To support language features like "go-to definition" across multiple files, please include `documents` key in the `graphql-config` file default or per-project (this was `include` in 2.0).
72
74
73
75
## Configuration Examples
74
76
@@ -127,6 +129,16 @@ Notice that `documents` key supports glob pattern and hence `["**/*.graphql"]` i
127
129
128
130
## Frequently Asked Questions
129
131
132
+
<spanid="legacy" />
133
+
134
+
### I can't load `.graphqlconfig` files anymore
135
+
136
+
If you need to use a legacy config file, then you just need to enable legacy mode for `graphql-config`:
137
+
138
+
```
139
+
"graphql-config.load.legacy": true
140
+
```
141
+
130
142
### Go to definition is not working for my URL
131
143
132
144
You can try the new experimental `cacheSchemaFileForLookup` option. NOTE: this will disable all definition lookup for local SDL graphql schema files, and _only_ perform lookup of the result an SDL result of `graphql-config``getSchema()`
@@ -245,9 +257,9 @@ which would search for `./config/.acmerc`, `.config/.acmerc.js`, `.config/acme.c
245
257
246
258
If you have multiple projects, you need to define one top-level config that defines all project configs using `projects`
247
259
248
-
### How do I highlight an embedded graphql string
260
+
### How do I highlight an embedded graphql string?
249
261
250
-
If you aren't using a template tag function, and just want to use a plain string, you can use an inline `#graphql` comment:
262
+
If you aren't using a template tag function such as `gql` or `graphql`, and just want to use a plain string, you can use an inline `#graphql` comment:
251
263
252
264
```ts
253
265
const myQuery = `#graphql
@@ -259,19 +271,27 @@ const myQuery = `#graphql
259
271
260
272
or
261
273
274
+
262
275
```ts
263
-
const myQuery = `
264
-
#graphql
276
+
const myQuery =
277
+
/* GraphiQL /
278
+
`
265
279
query {
266
280
something
267
281
}
268
282
`
269
283
```
284
+
285
+
### Template literal expressions dont work with `Execute Query`
286
+
287
+
Experimental support for template literal expressions ala `${}` has been added for language support, which just add an empty newline behind the scenes. It does not yet work for `Execute Query` codelans.
288
+
289
+
290
+
270
291
271
292
## Known Issues
272
293
273
-
- template replacement inside a graphql string [will break graphql parsing](https://github.com/graphql/vscode-graphql/issues/137). If you want to help improve partial parsing support, you can contribute to the parser efforts in [`graphql`](https://github.com/graphql/graphql-js) reference implementation. You can now re-use fragments across your project source, if you include the files in `documents`.
274
-
- the output channel occasionally shows "definition not found" when you first start the language service, but once the definition cache is built for each project, definition lookup will work. so if a "peek definition" fails when you first start, just try clicking it again.
294
+
- the output channel occasionally shows "definition not found" when you first start the language service, but once the definition cache is built for each project, definition lookup will work. so if a "peek definition" fails when you first start the editor or when you first install the extension, just try the definition lookup again.
0 commit comments