|
1 | 1 | # VSCode GraphQL
|
2 | 2 |
|
3 |
| -> **Note:** The primary maintainer @acao is on hiatus until December 2020 |
4 |
| -
|
5 | 3 | GraphQL extension VSCode built with the aim to tightly integrate the GraphQL Ecosystem with VSCode for an awesome developer experience.
|
6 | 4 |
|
7 | 5 | 
|
@@ -129,33 +127,41 @@ Notice that `documents` key supports glob pattern and hence `["**/*.graphql"]` i
|
129 | 127 |
|
130 | 128 | ## Frequently Asked Questions
|
131 | 129 |
|
132 |
| -### Go to definition is using `generated_schema.graphql`, not my schema source files |
| 130 | +### Go to definition is not working for my URL |
| 131 | + |
| 132 | +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()` |
133 | 133 |
|
134 |
| -Ah yes, this is now the default behavior used by most users, who do not have source SDL files. |
135 |
| -If you're using an "SDL first" methodology, such as with apollo, you'll want to enable `useSchemaFileDefinitions`. |
136 |
| -Add this to your settings: |
| 134 | +To enable, add this to your settings: |
137 | 135 |
|
138 | 136 | ```json
|
139 |
| -"vscode-graphql.useSchemaFileDefinitions": true, |
| 137 | +"vscode-graphql.cacheSchemaFileForLookup": true, |
140 | 138 | ```
|
141 | 139 |
|
142 | 140 | you can also use graphql config if you need to mix and match these settings:
|
143 | 141 |
|
144 | 142 | ```yml
|
| 143 | +schema: http://myschema.com/graphql |
| 144 | +extensions: |
| 145 | + languageService: |
| 146 | + cacheSchemaFileForLookup: true |
145 | 147 | projects:
|
146 | 148 | project1:
|
147 | 149 | schema: project1/schema/schema.graphql
|
148 | 150 | documents: project1/queries/**/*.{graphql,tsx,jsx,ts,js}
|
149 | 151 | extensions:
|
150 | 152 | languageService:
|
151 |
| - useSchemaFileDefinitions: true |
| 153 | + cacheSchemaFileForLookup: false |
| 154 | + |
152 | 155 | project2:
|
153 | 156 | schema: https://api.spacex.land/graphql/
|
154 | 157 | documents: project2/queries.graphql
|
155 | 158 | extensions:
|
156 | 159 | endpoints:
|
157 | 160 | default:
|
158 | 161 | url: https://api.spacex.land/graphql/
|
| 162 | + languageService: |
| 163 | + # Do project configs inherit parent config? |
| 164 | + cacheSchemaFileForLookup: true |
159 | 165 | ```
|
160 | 166 |
|
161 | 167 | ### The extension fails with errors about duplicate types
|
@@ -189,9 +195,22 @@ So you'll need to add something like this to your global vscode settings:
|
189 | 195 |
|
190 | 196 | The best way to make "execute <op type>" codelens work is to add endpoints config to the global graphql config or the project config.
|
191 | 197 |
|
192 |
| -The config example above shows how to configure endpoints. |
| 198 | +This would look like: |
| 199 | + |
| 200 | +```ts |
| 201 | +export default { |
| 202 | + schema: "mschema.graphql", |
| 203 | + extension: { |
| 204 | + endpoints: { |
| 205 | + default: "http://localhost:9000", |
| 206 | + }, |
| 207 | + }, |
| 208 | +} |
| 209 | +``` |
| 210 | + |
| 211 | +(see above for per-project examples) |
193 | 212 |
|
194 |
| -If there is an issue with execution that has to do with your server, the error response should show now in the results panel. |
| 213 | +If there is an issue with execution that has to do with your server, the error response should show now in the result panel. |
195 | 214 |
|
196 | 215 | In case the request fails due to self signed certificate, you can bypass that check by adding this to your settings:
|
197 | 216 |
|
|
0 commit comments