Options
All
  • Public
  • Public/Protected
  • All
Menu

Package vscode-graphql-execution

graphql.vscode-graphql-execution

This extension provides standalone support for executing graphql operations inline in your code for:

  • .ts/.tsx
  • .js/.jsx
  • .graphql, .gql or .graphqls files

How it works

  1. A codelens will appear above all operations - clicking will begin executing the operation.
  2. (If variables are specified in the operation), a dialog will prompt for these variables
  3. Then, the results or network error should appear, voilĂ !
  4. If no endpoints are configured, it will exit early and tell you to define them.

Configuring the extension

graphql-config

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'

Disable codelens

To disable the codelens, please specify this setting in settings.json or user.json:

{
  ...
 "vscode-graphql-execution.showExecCodelens": false
}

Self Signed Certificates

Enable this (false by default) to allow node to use non-authorized SSL certificates.

{
  "vscode-graphql-execution.rejectUnauthorized": true
}

Index

Type aliases

Endpoints

Endpoints: Record<string, Endpoint>

FragmentInfo

FragmentInfo: { content: string; definition: FragmentDefinitionNode; filePath?: undefined | string }

Type declaration

  • content: string
  • definition: FragmentDefinitionNode
  • Optional filePath?: undefined | string

GraphQLScalarTSType

GraphQLScalarTSType: string | number | boolean

GraphQLScalarType

GraphQLScalarType: "String" | "Float" | "Int" | "Boolean" | string

UserVariables

UserVariables: {}

Type declaration

WithList

WithList<T>: T | T[]

Type parameters

  • T

Functions

Const EndpointsExtension

  • EndpointsExtension(): { name: string }

Const LanguageServiceExecutionExtension

  • LanguageServiceExecutionExtension(api: ExtensionAPI): { name: string }

activate

  • activate(context: ExtensionContext): void

deactivate

  • deactivate(): void

Const getFragmentDependencies

  • getFragmentDependencies(query: string, fragmentDefinitions?: Map<string, FragmentInfo> | null): Promise<FragmentInfo[]>

Const getFragmentDependenciesForAST

  • getFragmentDependenciesForAST(parsedQuery: ASTNode, fragmentDefinitions: Map<string, FragmentInfo>): Promise<FragmentInfo[]>

Generated using TypeDoc