UNPKG

shyft

Version:

Model driven GraphQL API framework

56 lines (55 loc) 2.05 kB
import { GraphQLObjectType, GraphQLList } from 'graphql'; import { ConnectionNode } from './types'; import { Configuration, Entity } from '..'; import { GraphRegistryType } from './graphRegistry'; export declare const generateConnectionArgs: (entity: any, graphRegistry: any) => { first: { type: import("graphql").GraphQLScalarType; }; after: { type: import("graphql").GraphQLScalarType; }; last: { type: import("graphql").GraphQLScalarType; }; before: { type: import("graphql").GraphQLScalarType; }; offset: { type: import("graphql").GraphQLScalarType; }; orderBy: { type: GraphQLList<import("graphql").GraphQLType>; description: string; defaultValue: any[]; }; filter: { type: any; description: string; }; }; export declare const validateConnectionArgs: (_source: any, args: any) => void; export declare const forceSortByUnique: (orderBy: any, entity: any) => void; export declare const generateConnectionType: (config: any) => { edgeType: GraphQLObjectType<any, any>; connectionType: GraphQLObjectType<any, any>; }; export declare const buildCursor: (entityName: any, primaryAttributeName: any, args: any, data: any) => { [x: number]: any[]; }; export interface Connection { edges: ConnectionNode[]; totalCount: () => Promise<number>; pageInfo: { startCursor: string | null; endCursor: string | null; hasPreviousPage: boolean; hasNextPage: boolean; }; } export declare const connectionFromData: ({ transformedData, originalData }: { transformedData: any; originalData: any; }, entity: any, _source: any, args: any, context: any, _info: any, parentConnection: any, pageInfoFromData: any) => Connection; export declare const registerConnection: (graphRegistry: any, entity: any) => void; export declare const generateReverseConnections: (configuration: Configuration, graphRegistry: GraphRegistryType, entity: Entity) => Record<string, unknown>;