0.0.13 • Published 2 years ago

@madxnl/chessur v0.0.13

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

Frontend SDK for madhatter apps

Setup

To use the SDK initialize it with a GraphQLClient

import { GraphQLClient } from 'graphql-request'
import { MadhatterGraphQLClient } from '@madxnl/chessur'

const client = new GraphQLClient(baseURL, options)

const madhatterGraphqlClient = new MadhatterGraphQLClient(client)

To enforce type safety you can supply Query and Mutation types.

import { Query, Mutation, MutationVariables, QueryVariables } from '@/generated/sdk'

export const madhatterGraphqlClient =
  new MadhatterGraphQLClient<
    Query,
    Mutation,
    QueryVariables,
    MutationVariables
    >(client)

The Codegen Plugin provided by the library prepares you the neccesary types.

Codegen Plugin

To use the Codegen plugin simply include it in your codegen configuration.

In codegen.yml:

...
generates:
  src/generated/sdk.ts:
    ...
    plugins:
        ...
      - '@madxnl/chessur/codegen-plugin'
0.0.12

2 years ago

0.0.13

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.3

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2-beta.11

2 years ago

0.0.2-beta.10

2 years ago

0.0.2-beta.9

2 years ago

0.0.2-beta.8

2 years ago

0.0.2-beta.7

2 years ago

0.0.2-beta.6

2 years ago

0.0.2-beta.5

2 years ago

0.0.2-beta.4

2 years ago

0.0.2-beta.3

2 years ago

0.0.2-beta.2

2 years ago

0.0.2-beta.1

2 years ago