@serodigital/ies-api-client
v1.139.0-74c43d1e
Published
A Typescript GQL Client for IES
Downloads
1,254
Readme
IES Api Client
A Typescript GQL Client for IES
Installing
npm i @sero-digital/ies-api-client
Usage
Using the client as a third party application
import { IESApiClient } from '@sero-digital/ies-api-client';
const client = new IESApiClient('graphqlApiUrl', {
type: 'client',
auth0Domain: 'https://auth0Domain',
auth0Audience: 'auth0Audience',
clientId: '12345',
clientSecret: 'tty12',
});
Using the client as a first party application
const client = new IESApiClient('graphqlApiUrl', {
type: 'jwt',
token: 'bearer token here',
});
Making queries and mutations
const result = client.run<QueryOrMutationType, QueryOrMutationVariables>(SomeGQLDocument, {
variables: {
...values,
},
fetchPolicy,
headers,
});
Client Run API
| Option | Required | Default | | ----------- | -------- | ----------- | | Document | true | N/A | | Variables | false | {} | | FetchPolicy | false | cache-first | | Headers | false | undefined |