12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import { GraphQLInterfaceType } from 'graphql';
- import type {
- GraphQLFieldConfig,
- GraphQLResolveInfo,
- GraphQLTypeResolver,
- } from 'graphql';
- interface GraphQLNodeDefinitions<TContext> {
- nodeInterface: GraphQLInterfaceType;
- nodeField: GraphQLFieldConfig<unknown, TContext>;
- nodesField: GraphQLFieldConfig<unknown, TContext>;
- }
- export declare function nodeDefinitions<TContext>(
- fetchById: (
- id: string,
- context: TContext,
- info: GraphQLResolveInfo,
- ) => unknown,
- typeResolver?: GraphQLTypeResolver<any, TContext>,
- ): GraphQLNodeDefinitions<TContext>;
- interface ResolvedGlobalId {
- type: string;
- id: string;
- }
- export declare function toGlobalId(type: string, id: string | number): string;
- export declare function fromGlobalId(globalId: string): ResolvedGlobalId;
- export declare function globalIdField<TContext>(
- typeName?: string,
- idFetcher?: (
- obj: any,
- context: TContext,
- info: GraphQLResolveInfo,
- ) => string | number,
- ): GraphQLFieldConfig<any, TContext>;
- export {};
|