@@ -5,7 +5,6 @@ import { expressMiddleware } from '@apollo/server/express4'
55import express from 'express'
66import {
77 type GraphQLFormattedError ,
8- type GraphQLSchema
98} from 'graphql'
109import { ApolloServer , type ApolloServerOptions } from '@apollo/server'
1110import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled'
@@ -49,7 +48,7 @@ function formatError (graphqlConfig: GraphQLConfig | undefined) {
4948
5049export async function createExpressServer (
5150 config : Pick < KeystoneConfig , 'graphql' | 'server' | 'storage' > ,
52- graphQLSchema : GraphQLSchema , // TODO: redundant, prefer context.graphql.schema, remove in breaking change
51+ _ : any , // TODO: uses context.graphql.schema now , remove in breaking change
5352 context : KeystoneContext
5453) : Promise < {
5554 expressServer : express . Express
@@ -85,7 +84,7 @@ export async function createExpressServer (
8584 }
8685
8786 await config . server ?. extendExpressApp ?.( expressServer , context )
88- await config . server ?. extendHttpServer ?.( httpServer , context , graphQLSchema )
87+ await config . server ?. extendHttpServer ?.( httpServer , context , context . graphql . schema )
8988
9089 if ( config . storage ) {
9190 for ( const val of Object . values ( config . storage ) ) {
@@ -117,7 +116,7 @@ export async function createExpressServer (
117116 includeStacktraceInErrorResponses : config . graphql ?. debug ,
118117
119118 ...apolloConfig ,
120- schema : graphQLSchema ,
119+ schema : context . graphql . schema ,
121120 plugins :
122121 playgroundOption === 'apollo'
123122 ? apolloConfig ?. plugins
0 commit comments