@miragejs/graphql
Version:
A library for handling GraphQL requests with Mirage JS
16 lines (15 loc) • 878 B
TypeScript
import { GraphQLInterfaceType, GraphQLResolveInfo } from "graphql";
import type { ResolverContext, QueryArgs } from "../@types/index.js";
/**
* Resolves a field that returns an interface type. If the query includes an
* inline fragment, it uses that to determine the implementation type by which
* to resolve. If no inline fragment is specified, it gets all implementation
* types and looks for a record matching any of those.
*
* The latter case could be unreliable and in such cases it is advised that an
* optional resolver be passed into the handler for the particular field. In
* either case, it delegates to `resolveObject`.
*
* @see {@link https://graphql.org/learn/execution/#root-fields-resolvers}
*/
export default function resolveInterface(source: any, args: QueryArgs, context: ResolverContext, info: GraphQLResolveInfo, type: GraphQLInterfaceType): any;