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

4.5.6 • Public • Published

Whole Home Survey Api Client

A Typescript GQL Client for Whole Home Survey

Installing

npm i @sero-digital/whs-api-client

Usage

Using the client as a third party application

import { WholeHomeSurveyApiClient } from '@sero-digital/whs-api-client';

const client = new WholeHomeSurveyApiClient('graphqlApiUrl', {
  type: 'client',
  auth0Domain: 'https://auth0Domain',
  auth0Audience: 'auth0Audience',
  clientId: '12345',
  clientSecret: 'tty12',
});

Using the client as a first party application

const client = new WholeHomeSurveyApiClient('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/whs-api-client

Weekly Downloads

520

Version

4.5.6

License

ISC

Unpacked Size

1.6 MB

Total Files

12

Last publish

Collaborators

  • serodigital