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
//should the language service read schema for definition lookups from a cached file based on graphql config output?
160
+
//this is enabled by default if non-local files are specified in the project `schema`
161
161
// NOTE: this will disable all definition lookup for local SDL files
162
162
cacheSchemaFileForLookup:true,
163
163
// undefined by default which has the same effect as `true`, set to `false` if you are already using // `graphql-eslint` or some other tool for validating graphql in your IDE. Must be explicitly `false` to disable this feature, not just "falsy"
@@ -237,14 +237,14 @@ via `initializationOptions` in nvim.coc. The options are mostly designed to
237
237
configure graphql-config's load parameters, the only thing we can't configure
238
238
with graphql config. The final option can be set in `graphql-config` as well
|`graphql-config.load.baseDir`| workspace root or process.cwd() | the path where graphql config looks for config files |
243
-
|`graphql-config.load.filePath`|`null`| exact filepath of the config file. |
244
-
|`graphql-config.load.configName`|`graphql`| config name prefix instead of `graphql`|
245
-
|`graphql-config.load.legacy`|`true`| backwards compatibility with `graphql-config@2`|
246
-
|`graphql-config.dotEnvPath`|`null`| backwards compatibility with `graphql-config@2`|
247
-
|`vscode-graphql.cacheSchemaFileForLookup`|`false`| generate an SDL file based on your graphql-config schema configuration for schema definition lookup and other features. useful when your `schema` config are urls |
|`graphql-config.load.baseDir`| workspace root or process.cwd() | the path where graphql config looks for config files|
243
+
|`graphql-config.load.filePath`|`null`| exact filepath of the config file.|
244
+
|`graphql-config.load.configName`|`graphql`| config name prefix instead of `graphql`|
245
+
|`graphql-config.load.legacy`|`true`| backwards compatibility with `graphql-config@2`|
246
+
|`graphql-config.dotEnvPath`|`null`| backwards compatibility with `graphql-config@2`|
247
+
|`vscode-graphql.cacheSchemaFileForLookup`|`true` if `schema` contains non-sdl files or urls | generate an SDL file based on your graphql-config schema configuration for schema definition lookup and other features. enabled by default when your `schema` config are urls or introspection json, or if you have any non-local SDL files in `schema`|
248
248
249
249
all the `graphql-config.load.*` configuration values come from static
### The extension fails with errors about duplicate types
200
111
201
-
Make sure that you aren't including schema files in the `documents` blob
112
+
Your object types must be unique per project (as they must be unique per schema), and your fragment names must also be unique per project.
202
113
203
114
### The extension fails with errors about missing scalars, directives, etc
204
115
@@ -232,6 +143,7 @@ You can search a folder for any of the matching config file names listed above:
232
143
233
144
```json
234
145
"graphql-config.load.rootDir": "./config"
146
+
"graphql-config.envFilePath": "./config/.dev.env"
235
147
```
236
148
237
149
Or a specific filepath:
@@ -253,39 +165,15 @@ which would search for `./config/.acmerc`, `.config/.acmerc.js`,
253
165
If you have multiple projects, you need to define one top-level config that
254
166
defines all project configs using `projects`
255
167
256
-
### How do I highlight an embedded graphql string?
257
-
258
-
If you aren't using a template tag function such as `gql` or `graphql`, and just
259
-
want to use a plain string, you can use an inline `#graphql` comment:
168
+
### How do I enable language features for an embedded graphql string?
260
169
261
-
```ts
262
-
const myQuery = `#graphql
263
-
query {
264
-
something
265
-
}
266
-
`;
267
-
```
268
-
269
-
or
270
-
271
-
```ts
272
-
const myQuery =
273
-
/* GraphQL */
274
-
275
-
`
276
-
query {
277
-
something
278
-
}
279
-
`;
280
-
```
170
+
Please refer to the `vscode-graphql-syntax` reference files ([js](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.js),[ts](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts),[svelte](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.svelte),[vue](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.vue)) to learn our template tag, comment and other graphql delimiter patterns for the file types that the language server supports. The syntax highlighter currently supports more languages than the language server. If you notice any places where one or the other doesn't work, please report it!
281
171
282
172
## Known Issues
283
173
284
-
- the output channel occasionally shows "definition not found" when you first
285
-
start the language service, but once the definition cache is built for each
286
-
project, definition lookup will work. so if a "peek definition" fails when you
287
-
first start the editor or when you first install the extension, just try the
288
-
definition lookup again.
174
+
- the locally generated schema file for definition lookup currently does not re-generate on schema changes. this will be fixed soon.
175
+
- multi-root workspaces support will be added soon as well.
176
+
- some graphql-config options aren't always honored, this will also be fixed soon
289
177
290
178
## Attribution
291
179
@@ -312,7 +200,7 @@ This plugin uses the
312
200
### Contributing back to this project
313
201
314
202
This repository is managed by EasyCLA. Project participants must sign the free
0 commit comments