GraphqlClient
@tribeplatform/gql-client / Modules / clients / GraphqlClient
#
Class: GraphqlClientclients.GraphqlClient
#
HierarchyBaseGraphQLClient
↳
GraphqlClient
#
Table of contents#
Constructors#
Methods#
Constructors#
constructor• new GraphqlClient(options
)
#
ParametersName | Type |
---|---|
options | TribeClientOptions |
#
OverridesBaseGraphQLClient.constructor
#
Defined inpackages/client/src/clients/graphql.client.ts:69
#
Methods#
authorizedRequest▸ authorizedRequest<T
>(options
): Promise
<T
>
#
Type parametersName |
---|
T |
#
ParametersName | Type |
---|---|
options | RequestOptions |
#
ReturnsPromise
<T
>
#
Defined inpackages/client/src/clients/graphql.client.ts:95
#
batchRequests▸ batchRequests<T
, V
>(documents
, requestHeaders?
): Promise
<T
>
Send a GraphQL document to the server.
#
Type parametersName | Type |
---|---|
T | extends unknown = any |
V | Variables |
#
ParametersName | Type |
---|---|
documents | BatchRequestDocument <V >[] |
requestHeaders? | HeadersInit |
#
ReturnsPromise
<T
>
#
Inherited fromBaseGraphQLClient.batchRequests
#
Defined innode_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 parametersName | Type |
---|---|
T | any |
V | Variables |
#
ParametersName | Type |
---|---|
query | string |
variables? | V |
requestHeaders? | HeadersInit |
#
ReturnsPromise
<{ data
: T
; extensions?
: any
; headers
: Headers
; status
: number
}>
#
Inherited fromBaseGraphQLClient.rawRequest
#
Defined innode_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 parametersName | Type |
---|---|
T | any |
V | Variables |
#
ParametersName | Type |
---|---|
document | RequestDocument |
variables? | V |
requestHeaders? | HeadersInit |
#
ReturnsPromise
<T
>
#
Inherited fromBaseGraphQLClient.request
#
Defined innode_modules/graphql-request/dist/index.d.ts:20
#
setEndpoint▸ setEndpoint(value
): GraphQLClient
Change the client endpoint. All subsequent requests will send to this endpoint.
#
ParametersName | Type |
---|---|
value | string |
#
ReturnsGraphQLClient
#
Inherited fromBaseGraphQLClient.setEndpoint
#
Defined innode_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.
#
ParametersName | Type |
---|---|
key | string |
value | string |
#
ReturnsGraphQLClient
#
Inherited fromBaseGraphQLClient.setHeader
#
Defined innode_modules/graphql-request/dist/index.d.ts:29
#
setHeaders▸ setHeaders(headers
): GraphQLClient
#
ParametersName | Type |
---|---|
headers | HeadersInit |
#
ReturnsGraphQLClient
#
Inherited fromBaseGraphQLClient.setHeaders
#
Defined innode_modules/graphql-request/dist/index.d.ts:25
#
setToken▸ setToken(accessToken
): void
#
ParametersName | Type |
---|---|
accessToken | string |
#
Returnsvoid