UNPKG

@miragejs/graphql

Version:

A library for handling GraphQL requests with Mirage JS

15 lines (14 loc) 717 B
import { GraphQLSchema } from "graphql"; import type MirageSchema from "miragejs/lib/orm/schema.js"; /** * Create models in Mirage’s schema for each appropriate type in the GraphQL * schema*. We do this for 2 main reasons: * * 1. It saves us from having to specify models in the Mirage server setup that * essentially duplicate information we already have in the GraphQL schema. * 2. It ensures relationships are properly established in the Mirage schema. * * *You can still define models in your Mirage server setup. In those cases, this * function will not attempt to create them automatically. */ export declare function createModels(graphQLSchema: GraphQLSchema, mirageSchema: MirageSchema): void;