4.5.6 • Published 2 years ago

@serodigital/whs-api-client v4.5.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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

OptionRequiredDefault
DocumenttrueN/A
Variablesfalse{}
FetchPolicyfalsecache-first
Headersfalseundefined
4.5.6

2 years ago

4.5.5

2 years ago

4.4.0

3 years ago

4.3.1

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago