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 |