Skip to content

Latest commit

 

History

History
162 lines (100 loc) · 3.54 KB

api.md

File metadata and controls

162 lines (100 loc) · 3.54 KB

Modules

GraficoQL

A minimal graphql client.

Classes

GraphQLClient

GraficoQL

A minimal graphql client.


GraficoQL.create(url, options) ⇒ GraphQLClient

Creates an object to request a graphql endpoint.

Kind: static method of GraficoQL
Throws:

  • ReferenceError
Param Type
url String
options Object

GraficoQL.request(url, query, variables) ⇒ Promise

Requests a graphql endpoint.

Kind: static method of GraficoQL
Throws:

  • ReferenceError
Param Type
url String
query String
variables Object

GraficoQL.rawRequest(url, query, variables) ⇒ Promise

Requests a graphql endpoint. The complete response will be transmit to the resolved promise.

Kind: static method of GraficoQL
Throws:

  • ReferenceError
Param Type
url String
query String
variables Object

GraphQLClient ℗

Kind: global class
Access: private


new GraphQLClient(url, options)

Param Type Description
url String The url of the graphql endpoint
options Object

graphQLClient.setHeader(key, value) ⇒ this

Set a header-key.

Kind: instance method of GraphQLClient

Param Type
key String
value String

graphQLClient.request(query, variables) ⇒ Promise

Requests the stored graphql endpoint.

Kind: instance method of GraphQLClient

Param Type
query String
variables Object

graphQLClient.rawRequest(query, variables) ⇒ Promise

Requests the stored graphql endpoint. The complete response will be transmit to the resolved promise.

Kind: instance method of GraphQLClient

Param Type
query String
variables Object