hackernews-node/node_modules/graphql-middleware/dist/middleware.js
/**
 *
 * @param schema
 * @param options
 * @param middleware
 *
 * Validates middleware and generates resolvers map for provided middleware.
 * Applies middleware to the current schema and returns the modified one.
 *
 */


Validates middleware and generates resolvers map for provided middleware.
Applies middleware to the current schema and returns the modified one.
Validates middleware and generates resolvers map for provided middleware . Applies middleware to the current schema and returns the modified one .
function addMiddlewareToSchema(schema, options, middleware) {
    var validMiddleware = validation_1.validateMiddleware(schema, middleware);
    var resolvers = applicator_1.generateResolverFromSchemaAndMiddleware(schema, options, validMiddleware);
    var fragmentReplacements = fragments_1.extractFragmentReplacements(resolvers);
    graphql_tools_1.addResolveFunctionsToSchema({
        schema: schema,
        resolvers: resolvers,
        resolverValidationOptions: {
            requireResolversForResolveType: false,
        },
    });
    return { schema: schema, fragmentReplacements: fragmentReplacements };
}
function addMiddlewareToSchema ( schema , options , middleware ) { var validMiddleware = validation_1 . validateMiddleware ( schema , middleware ) ; var resolvers = applicator_1 . generateResolverFromSchemaAndMiddleware ( schema , options , validMiddleware ) ; var fragmentReplacements = fragments_1 . extractFragmentReplacements ( resolvers ) ; graphql_tools_1 . addResolveFunctionsToSchema ( { schema : schema , resolvers : resolvers , resolverValidationOptions : { requireResolversForResolveType : false , } , } ) ; return { schema : schema , fragmentReplacements : fragmentReplacements } ; }
@param schema
 @param options
 @param middleware
@param schema @param options @param middleware