Skip to main content

GraphqlClient

@tribeplatform/gql-client / Modules / clients / GraphqlClient

Class: GraphqlClient#

clients.GraphqlClient

Hierarchy#

  • BaseGraphQLClient

    GraphqlClient

Table of contents#

Constructors#

Methods#

Constructors#

constructor#

new GraphqlClient(options)

Parameters#

NameType
optionsTribeClientOptions

Overrides#

BaseGraphQLClient.constructor

Defined in#

packages/client/src/clients/graphql.client.ts:69

Methods#

authorizedRequest#

authorizedRequest<T>(options): Promise<T>

Type parameters#

Name
T

Parameters#

NameType
optionsRequestOptions

Returns#

Promise<T>

Defined in#

packages/client/src/clients/graphql.client.ts:95


batchRequests#

batchRequests<T, V>(documents, requestHeaders?): Promise<T>

Send a GraphQL document to the server.

Type parameters#

NameType
Textends unknown = any
VVariables

Parameters#

NameType
documentsBatchRequestDocument<V>[]
requestHeaders?HeadersInit

Returns#

Promise<T>

Inherited from#

BaseGraphQLClient.batchRequests

Defined in#

node_modules/graphql-request/dist/index.d.ts:24


rawRequest#

rawRequest<T, V>(query, variables?, requestHeaders?): Promise<{ data: T ; extensions?: any ; headers: Headers ; status: number }>

Type parameters#

NameType
Tany
VVariables

Parameters#

NameType
querystring
variables?V
requestHeaders?HeadersInit

Returns#

Promise<{ data: T ; extensions?: any ; headers: Headers ; status: number }>

Inherited from#

BaseGraphQLClient.rawRequest

Defined in#

node_modules/graphql-request/dist/index.d.ts:11


request#

request<T, V>(document, variables?, requestHeaders?): Promise<T>

Send a GraphQL document to the server.

Type parameters#

NameType
Tany
VVariables

Parameters#

NameType
documentRequestDocument
variables?V
requestHeaders?HeadersInit

Returns#

Promise<T>

Inherited from#

BaseGraphQLClient.request

Defined in#

node_modules/graphql-request/dist/index.d.ts:20


setEndpoint#

setEndpoint(value): GraphQLClient

Change the client endpoint. All subsequent requests will send to this endpoint.

Parameters#

NameType
valuestring

Returns#

GraphQLClient

Inherited from#

BaseGraphQLClient.setEndpoint

Defined in#

node_modules/graphql-request/dist/index.d.ts:33


setHeader#

setHeader(key, value): GraphQLClient

Attach a header to the client. All subsequent requests will have this header.

Parameters#

NameType
keystring
valuestring

Returns#

GraphQLClient

Inherited from#

BaseGraphQLClient.setHeader

Defined in#

node_modules/graphql-request/dist/index.d.ts:29


setHeaders#

setHeaders(headers): GraphQLClient

Parameters#

NameType
headersHeadersInit

Returns#

GraphQLClient

Inherited from#

BaseGraphQLClient.setHeaders

Defined in#

node_modules/graphql-request/dist/index.d.ts:25


setToken#

setToken(accessToken): void

Parameters#

NameType
accessTokenstring

Returns#

void

Defined in#

packages/client/src/clients/graphql.client.ts:126