@mfellner/graphql-codegen-typescript-urql-sdk
v1.0.0
Published
GraphQL Code Generator plugin for generating a ready-to-use SDK based on urql client and GraphQL operations
Downloads
3,424
Maintainers
Readme
@graphql-codegen/typescript-urql-sdk
GraphQL Code Generator plugin for generating a ready-to-use SDK based on urql
client and GraphQL operations.
Usage
Configuration:
schema: YOUR_SCHEMA_HERE
documents: './src/**/*.graphql'
generates:
./generated-types.ts:
plugins:
- typescript
- typescript-operations
- typescript-urql-sdk
Generated SDK:
import { Client } from '@urql/core'
const client = new Client({ url: '/graphql' })
const sdk = getSdk(client)
await sdk.hello().toPromise()