UNPKG

@graphql-codegen/typescript-nest

Version:

GraphQL Code Generator plugin for generating NestJS compatible types

30 lines (29 loc) 2.51 kB
import { EnumTypeDefinitionNode, FieldDefinitionNode, GraphQLSchema, InputObjectTypeDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode, TypeDefinitionNode, TypeNode } from 'graphql'; import { TsVisitor, TypeScriptPluginParsedConfig } from '@graphql-codegen/typescript'; import { DeclarationBlock } from '@graphql-codegen/visitor-plugin-common'; import { NestPluginConfig } from './config.cjs'; import { DecoratorConfig, DecoratorOptions, Type } from './types.cjs'; export interface NestPluginParsedConfig extends TypeScriptPluginParsedConfig { disableDescriptions: boolean; decoratorName: DecoratorConfig; decorateTypes?: string[]; } export declare class NestVisitor<TRawConfig extends NestPluginConfig = NestPluginConfig, TParsedConfig extends NestPluginParsedConfig = NestPluginParsedConfig> extends TsVisitor<TRawConfig, TParsedConfig> { private typescriptVisitor; constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>); getBaseDecoratorOptions(node: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | FieldDefinitionNode | InputObjectTypeDefinitionNode | InputValueDefinitionNode): DecoratorOptions; getWrapperDefinitions(): string[]; getFixDecoratorDefinition(): string; getMaybeWrapper(): string; protected buildArgumentsBlock(node: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): string; ObjectTypeDefinition(node: ObjectTypeDefinitionNode, key: string | number, parent: any): string; InputObjectTypeDefinition(node: InputObjectTypeDefinitionNode): string; getArgumentsObjectDeclarationBlock(node: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, name: string, field: FieldDefinitionNode): DeclarationBlock; getArgumentsObjectTypeDefinition(node: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, name: string, field: FieldDefinitionNode): string; InterfaceTypeDefinition(node: InterfaceTypeDefinitionNode, key: string | number, parent: any): string; protected shouldBeDecorated(name: string): boolean; parseType(type: TypeNode | string): Type; FieldDefinition(node: FieldDefinitionNode, key?: string | number, parent?: any, _path?: any, ancestors?: TypeDefinitionNode[]): string; InputValueDefinition(node: InputValueDefinitionNode, key?: string | number, parent?: any, path?: (string | number)[], ancestors?: TypeDefinitionNode[]): string; EnumTypeDefinition(node: EnumTypeDefinitionNode): string; }