Skip to content

Interface: ApolloOptions<TContext>

Defined in: packages/apollo/src/interfaces/apollo-options.interface.ts:192

Options for configuring the GraphQL / Apollo module.

Type Parameters

Type ParameterDefault type
TContextunknown

Properties

PropertyTypeDescriptionDefined in
autoSchemaFile?string | booleanWhen true, generates schema from code-first decorators in memory. When a string path is provided, also writes the SDL to that file.packages/apollo/src/interfaces/apollo-options.interface.ts:218
buildSchemaOptions?BuildSchemaOptionsAdditional options used while building code-first schema.packages/apollo/src/interfaces/apollo-options.interface.ts:220
context?(context) => TContext | Promise<TContext>Context factory called for every request.packages/apollo/src/interfaces/apollo-options.interface.ts:202
formatError?(formattedError, error) => GraphQLFormattedErrorCustom error formatter.packages/apollo/src/interfaces/apollo-options.interface.ts:206
path?stringGraphQL endpoint path. Default '/graphql'packages/apollo/src/interfaces/apollo-options.interface.ts:194
playground?booleanEnable Apollo Studio Sandbox landing page. Default true in developmentpackages/apollo/src/interfaces/apollo-options.interface.ts:204
plugins?ApolloServerPlugin<BaseContext>[]Additional Apollo Server plugins.packages/apollo/src/interfaces/apollo-options.interface.ts:224
resolvers?Record<string, unknown> | Record<string, unknown>[]Resolver map. Used together with typeDefs.packages/apollo/src/interfaces/apollo-options.interface.ts:200
schema?GraphQLSchemaPre-built GraphQL schema. Mutually exclusive with autoSchemaFile.packages/apollo/src/interfaces/apollo-options.interface.ts:196
sortSchema?booleanSort schema fields alphabetically.packages/apollo/src/interfaces/apollo-options.interface.ts:222
subscriptions?boolean | SubscriptionConfigEnable WebSocket subscriptions or pass graphql-ws options.packages/apollo/src/interfaces/apollo-options.interface.ts:211
subscriptionsPath?stringWebSocket endpoint for subscriptions.packages/apollo/src/interfaces/apollo-options.interface.ts:213
typeDefs?string | string[]SDL type definitions. Used together with resolvers.packages/apollo/src/interfaces/apollo-options.interface.ts:198
upload?UploadOptionsFile upload limits for multipart requests.packages/apollo/src/interfaces/apollo-options.interface.ts:226

Released under the MIT License.