@miragejs/graphql
Version:
A library for handling GraphQL requests with Mirage JS
27 lines (26 loc) • 1.1 kB
TypeScript
import { GraphQLSchema, GraphQLType } from "graphql";
import type { SourceGraphQLSchema } from "./@types/index.js";
/**
* Capitalize the first character of a string. If the first character of the
* given string is not a letter, there is no effect.
*/
export declare function capitalize(str: string): string;
/**
* Given a GraphQL schema which may be a string or an AST, it returns an
* executable version of that schema. If the schema passed in is already
* executable, it returns the schema as-is.
*/
export declare function ensureExecutableGraphQLSchema(graphQLSchema: SourceGraphQLSchema): GraphQLSchema;
/**
* Unwraps GraphQL types, e.g., a non-null list of objects, to determine the
* underlying type. It also considers types like Relay connections and edges.
* This is useful when querying for list or non-null types and needing to know
* which underlying type of record(s) to fetch from Mirage's database.
*/
export declare function unwrapType(type: GraphQLType, options?: {
considerRelay: boolean;
isList: boolean;
}): {
isList: boolean;
type: GraphQLType;
};