@quell/server
Version:
Quell is an open-source NPM package providing a light-weight caching layer implementation and cache invalidation for GraphQL responses on both the client- and server-side. Use Quell to prevent redundant client-side API requests and to minimize costly serv
43 lines • 1.82 kB
TypeScript
import { GraphQLSchema } from "graphql";
import { FieldsMapType, QueryMapType, MutationMapType } from "../types/types";
/**
* Converts any GraphQL schema to a standardized format that Quell can process
* using GraphQL's introspection system.
*
* @param schema - Any valid GraphQL schema
* @returns A standardized GraphQL schema that Quell can work with
*/
export declare function anySchemaToQuellSchema(schema: GraphQLSchema): GraphQLSchema;
/**
* Generates a map of queries to GraphQL object types using the public GraphQL API.
* This works with any GraphQL schema regardless of how it was created.
*
* @param schema - Any valid GraphQL schema
* @returns Map of queries to their return types
*/
export declare function getQueryMap(schema: GraphQLSchema): QueryMapType;
/**
* Generates a map of mutations to GraphQL object types using the public GraphQL API.
* This works with any GraphQL schema regardless of how it was created.
*
* @param schema - Any valid GraphQL schema
* @returns Map of mutations to their affected types
*/
export declare function getMutationMap(schema: GraphQLSchema): MutationMapType;
/**
* Generates a map of fields to GraphQL types using the public GraphQL API.
* This works with any GraphQL schema regardless of how it was created.
*
* @param schema - Any valid GraphQL schema
* @returns Map of fields to their GraphQL types
*/
export declare function getFieldsMap(schema: GraphQLSchema): FieldsMapType;
/**
* Determines which schema types are affected by a given mutation.
* This is useful for intelligent cache invalidation.
*
* @param schema - Any valid GraphQL schema
* @returns Map of mutations to the types they affect
*/
export declare function generateMutationMap(schema: GraphQLSchema): Record<string, string[]>;
//# sourceMappingURL=schemaHelpers.d.ts.map