Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting exactOptionalPropertyTypes #2111

Merged
merged 4 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions packages/graphql-yoga/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export type YogaServerOptions<TServerContext, TUserContext> = {
* Enable/disable logging or provide a custom logger.
* @default true
*/
logging?: boolean | YogaLogger | LogLevel
logging?: boolean | YogaLogger | LogLevel | undefined
/**
* Prevent leaking unexpected errors to the client. We highly recommend enabling this in production.
* If you throw `EnvelopError`/`GraphQLError` within your GraphQL resolvers then that error will be sent back to the client.
Expand All @@ -97,7 +97,7 @@ export type YogaServerOptions<TServerContext, TUserContext> = {
*
* @default true
*/
maskedErrors?: boolean | Partial<YogaMaskedErrorOpts>
maskedErrors?: boolean | Partial<YogaMaskedErrorOpts> | undefined
/**
* Context
*/
Expand All @@ -107,39 +107,40 @@ export type YogaServerOptions<TServerContext, TUserContext> = {
) => Promise<TUserContext> | TUserContext)
| Promise<TUserContext>
| TUserContext
| undefined

cors?: Parameters<typeof useCORS>[0]
cors?: Parameters<typeof useCORS>[0] | undefined

/**
* GraphQL endpoint
* So you need to define it explicitly if GraphQL API lives in a different path other than `/graphql`
*
* @default "/graphql"
*/
graphqlEndpoint?: string
graphqlEndpoint?: string | undefined

/**
* Readiness check endpoint
*
* @default "/health"
*/
healthCheckEndpoint?: string
healthCheckEndpoint?: string | undefined

/**
* Whether the landing page should be shown.
*/
landingPage?: boolean
landingPage?: boolean | undefined

/**
* GraphiQL options
*
* @default true
*/
graphiql?: GraphiQLOptionsOrFactory<TServerContext>
graphiql?: GraphiQLOptionsOrFactory<TServerContext> | undefined

renderGraphiQL?: (options?: GraphiQLOptions) => PromiseOrValue<BodyInit>
renderGraphiQL?: ((options?: GraphiQLOptions) => PromiseOrValue<BodyInit>) | undefined

schema?: YogaSchemaDefinition<TUserContext & TServerContext>
schema?: YogaSchemaDefinition<TUserContext & TServerContext> | undefined

/**
* Envelop Plugins
Expand All @@ -148,28 +149,28 @@ export type YogaServerOptions<TServerContext, TUserContext> = {
plugins?: Array<
// eslint-disable-next-line @typescript-eslint/ban-types
Plugin<TUserContext & TServerContext & YogaInitialContext> | Plugin | {}
>
> | undefined

parserCache?: boolean | ParserAndValidationCacheOptions
validationCache?: boolean | ValidationCache
fetchAPI?: Partial<Record<keyof FetchAPI, any>>
parserCache?: boolean | ParserAndValidationCacheOptions | undefined
validationCache?: boolean | ValidationCache | undefined
fetchAPI?: Partial<Record<keyof FetchAPI, any>> | undefined
/**
* GraphQL Multipart Request spec support
*
* @see https://github.com/jaydenseric/graphql-multipart-request-spec
*
* @default true
*/
multipart?: boolean
id?: string
multipart?: boolean | undefined
id?: string | undefined
/**
* Batching RFC Support configuration
*
* @see https://github.com/graphql/graphql-over-http/blob/main/rfcs/Batching.md
*
* @default false
*/
batching?: BatchingOptions
batching?: BatchingOptions | undefined
/**
* Whether to use the legacy Yoga Server-Sent Events and not
* the GraphQL over SSE spec's distinct connection mode.
Expand Down
Loading
Loading