UNPKG

graphql-shield

Version:

GraphQL Server permissions as another layer of abstraction!

24 lines (23 loc) 747 B
import { GraphQLSchema } from 'graphql'; import { IOptions, IOptionsConstructor, IMiddlewareTypeMap, IRules } from './types.js'; import { FragmentReplacement } from './fragments.js'; /** * * @param options * * Makes sure all of defined rules are in accord with the options * shield can process. * */ export declare function normalizeOptions(options: IOptionsConstructor): IOptions; export declare function getFragmentReplacements(middleware: IMiddlewareTypeMap): FragmentReplacement[]; /** * * @param schema * @param ruleTree * @param options * * Validates rules and applies defined rule tree to the schema. * */ export declare function shield(schema: GraphQLSchema, ruleTree: IRules, options?: IOptionsConstructor): GraphQLSchema;