@opvious/api-operations
TypeScript icon, indicating that this package has built-in type declarations

0.10.3 • Public • Published

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).

Readme

Keywords

Package Sidebar

Install

npm i @opvious/api-operations

Weekly Downloads

6

Version

0.10.3

License

Apache-2.0

Unpacked Size

554 kB

Total Files

44

Last publish

Collaborators

  • opvious-eng