Skip to content

Commit

Permalink
Expose ApolloServerOptions* interfaces (#7311)
Browse files Browse the repository at this point in the history
The fine-grained `ApolloServerOptions*` types form the top-level
`ApolloServerOptions` type can be useful to library authors. This commit
exports these types as part of Apollo Server's public API.
  • Loading branch information
axe-me authored Jan 18, 2023
1 parent ee36bfc commit 322b5eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-rats-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@apollo/server': patch
---

Export intermediate ApolloServerOptions\* types
6 changes: 3 additions & 3 deletions packages/server/src/externalTypes/constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@ interface ApolloServerOptionsBase<TContext extends BaseContext> {
__testing_incrementalExecutionResults?: GraphQLExperimentalIncrementalExecutionResults;
}

interface ApolloServerOptionsWithGateway<TContext extends BaseContext>
export interface ApolloServerOptionsWithGateway<TContext extends BaseContext>
extends ApolloServerOptionsBase<TContext> {
gateway: GatewayInterface;
schema?: undefined;
typeDefs?: undefined;
resolvers?: undefined;
}

interface ApolloServerOptionsWithSchema<TContext extends BaseContext>
export interface ApolloServerOptionsWithSchema<TContext extends BaseContext>
extends ApolloServerOptionsBase<TContext> {
schema: GraphQLSchema;
gateway?: undefined;
typeDefs?: undefined;
resolvers?: undefined;
}

interface ApolloServerOptionsWithTypeDefs<TContext extends BaseContext>
export interface ApolloServerOptionsWithTypeDefs<TContext extends BaseContext>
extends ApolloServerOptionsBase<TContext> {
// These two options are always only passed directly through to
// makeExecutableSchema. (If you don't want to use makeExecutableSchema, pass
Expand Down
4 changes: 4 additions & 0 deletions packages/server/src/externalTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export type {
ApolloConfig,
PersistedQueryOptions,
CSRFPreventionOptions,
ApolloServerOptionsWithSchema,
ApolloServerOptionsWithTypeDefs,
ApolloServerOptionsWithStaticSchema,
ApolloServerOptionsWithGateway,
ApolloServerOptions,
} from './constructor.js';

Expand Down

0 comments on commit 322b5eb

Please sign in to comment.