@sparklink-pro/apant
Version:
Apollo & Antd tools
34 lines • 1.57 kB
TypeScript
import { ApolloClient, DocumentNode } from '@apollo/client';
import { GraphQLType, TypeOperation, TypeOperationConfiguration, TypesRegistryInterface, TypesRegistryConfiguration, TypeConfigurationResolved } from '../definitions';
/**
* This is the registry of all the types is it used to get the types configuration and to resolve graphql operations for a given type.
*/
export declare class TypesRegistry implements TypesRegistryInterface {
types: {
[type: string]: TypeConfigurationResolved;
};
apollo?: ApolloClient;
operations: {
[name: string]: any;
};
configuration: TypeOperationConfiguration;
constructor({ types, apollo, operations, configuration }: TypesRegistryConfiguration);
getTypes(): string[];
hasType(type: GraphQLType): boolean;
getType(type: GraphQLType): TypeConfigurationResolved;
queryList(type: GraphQLType, options?: Omit<ApolloClient.QueryOptions, 'query'>): Promise<never[] | {
items: any;
data: unknown;
error?: import("@apollo/client").ErrorLike;
}>;
queryItem(type: GraphQLType, id: any, options?: Omit<ApolloClient.QueryOptions, 'query'>): Promise<never[] | {
item: any;
data: unknown;
error?: import("@apollo/client").ErrorLike;
}>;
getTypeFragmentName(type: GraphQLType): string;
getOperation(type: GraphQLType, operation: TypeOperation): DocumentNode;
error(type: GraphQLType, message: string, throwException?: boolean): void;
}
export default TypesRegistry;
//# sourceMappingURL=TypesRegistry.d.ts.map