@serodigital/ies-api-client
TypeScript icon, indicating that this package has built-in type declarations

1.125.1-d28dc002 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @serodigital/ies-api-client

Weekly Downloads

3,840

Version

1.125.1-d28dc002

License

ISC

Unpacked Size

143 kB

Total Files

14

Last publish

Collaborators

  • serodigital