@graphql-codegen/typescript-generic-sdk
Version:
GraphQL Code Generator plugin for generating a ready-to-use client-agnostic SDK based on GraphQL operations
30 lines (29 loc) • 1.06 kB
TypeScript
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
/**
* This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.
*/
export interface RawGenericSdkPluginConfig extends RawClientSideBasePluginConfig {
/**
* usingObservableFrom: `import Observable from 'zen-observable'`
* OR
* usingObservableFrom: `import { Observable } from 'rxjs'`
*/
usingObservableFrom?: string;
/**
* @description By default the `request` method return the `data` or `errors` key from the response. If you need to access the `extensions` key you can use the `rawRequest` method.
* @default false
*
* @exampleMarkdown
* ```yaml
* generates:
* path/to/file.ts:
* plugins:
* - typescript
* - typescript-operations
* - typescript-generic-sdk
* config:
* rawRequest: true
* ```
*/
rawRequest?: boolean;
}