diff --git a/applyGraphQL.ts b/applyGraphQL.ts index 3994bf2..fdfe7e3 100644 --- a/applyGraphQL.ts +++ b/applyGraphQL.ts @@ -2,6 +2,7 @@ import { graphql, gql } from "./deps.ts"; import { renderPlaygroundPage } from "./graphql-playground-html/render-playground-html.ts"; import { makeExecutableSchema } from "./graphql-tools/schema/makeExecutableSchema.ts"; import { fileUploadMiddleware, GraphQLUpload } from "./fileUpload.ts"; +import { SchemaTransform } from "./graphql-tools/utils/index.ts" interface Constructable { new (...args: any): T & OakRouter; @@ -19,6 +20,7 @@ export interface ApplyGraphQLOptions { resolvers: ResolversProps; context?: (ctx: any) => any; usePlayground?: boolean; + schemaTransforms?: SchemaTransform[] } export interface ResolversProps { @@ -34,6 +36,7 @@ export async function applyGraphQL({ resolvers, context, usePlayground = true, + schemaTransforms = [] }: ApplyGraphQLOptions): Promise { const router = new Router(); @@ -56,6 +59,7 @@ export async function applyGraphQL({ const schema = makeExecutableSchema({ typeDefs: augmentedTypeDefs, resolvers: [resolvers], + schemaTransforms }); await router.post(path, fileUploadMiddleware, async (ctx: any) => {