Skip to main content

gql

view on npm

Simple GraphQL query builder.

gql(chunks, ...variables) ⇒ string

Simple GraphQL query builder.

Returns: string

The built query


Todo

  • Improve type safety
  • Make this work better
ParamTypeDescription
chunksTemplateStringsArray

The template string chunks

...variablesArray.<any>

The variables to be interpolated into the query

.gql(query, variables) ⇒ Promise.<PlexusApiRes.<unknown>>

Send a graphql request

Returns: Promise.<PlexusApiRes.<unknown>>

The response from the server

ParamTypeDescription
querystring

The gql query to send

variablesRecord.<string, any>

Variables