Opvious API operations
This package contains auto-generated types for Opvious' GraphQL API. Consider also using our higher level SDK.
Quickstart
npm i @opvious/api-operations
You'll need an API access token to call SDK methods. You can generate one at https://hub.opvious.io/authorizations. Once you have it, you can use this package to emit type-safe API requests.
import {GraphQLClient} from 'graphql-request';
import {getSdk} from '@opvious/api-operations';
// Underlying generic GraphQL client.
const client = new GraphQLClient('https://api.opvious.io/graphql', {
headers: {authorization: process.env.OPVIOUS_TOKEN},
});
// Typesafe GraphQL SDK.
const sdk = getSdk(
<R, V>(query: string, vars: V) => client.rawRequest<R, V>(query, vars)
);
Resources
This package includes the following resource files:
- schema (
resources/schema.gql
); - supported operations (
resources/operations/**/*.graphql
).