This extension provides standalone support for executing graphql operations inline in your code for:
- .ts/.tsx
- .js/.jsx
- .graphql, .gql or .graphqls files
- A codelens will appear above all operations - clicking will begin executing the operation.
- (If variables are specified in the operation), a dialog will prompt for these variables
- Then, the results or network error should appear, voilà!
- If no endpoints are configured, it will exit early and tell you to define them.
Your graphql config file will need to contain either a schema-as-url OR an endpoints configuration. Either of the following are valid:
schema: https://localhost:3000/graphql
schema: schema.graphql
extensions:
endpoints:
default:
url: 'https://localhost:3000/graphql'
projects:
app:
schema: schema.graphql
extensions:
endpoints:
default:
url: 'https://localhost:3000/graphql'
To disable the codelens, please specify this setting in settings.json
or
user.json
:
{
...
"vscode-graphql-execution.showExecCodelens": false
}
Enable this (false
by default) to allow node to use non-authorized SSL
certificates.
{
"vscode-graphql-execution.rejectUnauthorized": true
}