Skip to content

Commit

Permalink
add deprecation notice for extendHttpServer arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Feb 15, 2024
1 parent e3f9b63 commit 544fb20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/lib/createExpressServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import cors from 'cors'
import { json } from 'body-parser'
import { expressMiddleware } from '@apollo/server/express4'
import express from 'express'
import { type GraphQLFormattedError, type GraphQLSchema } from 'graphql'
import {
type GraphQLFormattedError,
type GraphQLSchema
} from 'graphql'
import { ApolloServer, type ApolloServerOptions } from '@apollo/server'
import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled'
import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default'
Expand Down Expand Up @@ -46,7 +49,7 @@ function formatError (graphqlConfig: GraphQLConfig | undefined) {

export async function createExpressServer (
config: Pick<KeystoneConfig, 'graphql' | 'server' | 'storage'>,
graphQLSchema: GraphQLSchema, // TODO: redundant, remove in breaking change
graphQLSchema: GraphQLSchema, // TODO: redundant, prefer context.graphql.schema, remove in breaking change
context: KeystoneContext
): Promise<{
expressServer: express.Express
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/types/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export type ServerConfig<TypeInfo extends BaseKeystoneTypeInfo> = {
extendHttpServer?: (
server: Server,
context: KeystoneContext<TypeInfo>,
/** @deprecated, TODO: redundant, prefer context.graphql.schema, remove in breaking change */
graphqlSchema: GraphQLSchema
) => MaybePromise<void>
} & (
Expand Down

0 comments on commit 544fb20

Please sign in to comment.