@kazekyo/nau-graphql-codegen-preset
Version:
A GraphQL Code Generator preset for Nau
34 lines (33 loc) • 1.78 kB
TypeScript
import { Types } from '@graphql-codegen/plugin-helpers';
import { DirectiveName } from '@kazekyo/nau';
import { DirectiveNode, DocumentNode, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, SelectionNode, SelectionSetNode } from 'graphql';
export declare const pageInfoField: FieldNode;
export declare const cursorField: FieldNode;
export declare const idField: FieldNode;
export declare const typenameField: FieldNode;
export declare const nodeField: FieldNode;
export declare const edgesField: FieldNode;
export declare const connectionIdField: FieldNode;
export declare function getOperationDefinitions(doc: DocumentNode): OperationDefinitionNode[];
export declare const getFragmentDefinitions: (documentNode: DocumentNode) => FragmentDefinitionNode[];
export declare const getFragmentDefinitionsByDocumentFiles: (documentFiles: Types.DocumentFile[]) => FragmentDefinitionNode[];
export declare const getFragmentDefinitionByName: ({ fragmentDefinitions, fragmentName, }: {
fragmentDefinitions: FragmentDefinitionNode[];
fragmentName: string;
}) => FragmentDefinitionNode | undefined;
export declare const getDirectives: ({ node, directiveNames, }: {
node: FieldNode | SelectionNode | null;
directiveNames: DirectiveName[];
}) => DirectiveNode[];
export declare const isSameNameFieldNode: ({ selection, name }: {
selection: SelectionNode;
name: string;
}) => boolean;
export declare const addFieldWithoutDuplication: ({ fieldNode, additionalFields, }: {
fieldNode: FieldNode;
additionalFields: FieldNode[];
}) => FieldNode;
export declare const addFieldToSelectionSetNodeWithoutDuplication: ({ selectionSetNode, additionalFields, }: {
selectionSetNode: SelectionSetNode;
additionalFields: FieldNode[];
}) => SelectionSetNode;