A Typescript GQL Client for IES
npm i @sero-digital/ies-api-client
import { IESApiClient } from '@sero-digital/ies-api-client';
const client = new IESApiClient('graphqlApiUrl', {
type: 'client',
auth0Domain: 'https://auth0Domain',
auth0Audience: 'auth0Audience',
clientId: '12345',
clientSecret: 'tty12',
});
const client = new IESApiClient('graphqlApiUrl', {
type: 'jwt',
token: 'bearer token here',
});
const result = client.run<QueryOrMutationType, QueryOrMutationVariables>(SomeGQLDocument, {
variables: {
...values,
},
fetchPolicy,
headers,
});
Option | Required | Default |
---|---|---|
Document | true | N/A |
Variables | false | {} |
FetchPolicy | false | cache-first |
Headers | false | undefined |