Skip to content

Commit

Permalink
Export GraphQLOptions type directly from apollo-server-express.
Browse files Browse the repository at this point in the history
Directly export `GraphQLOptions` from the `apollo-server-express` (and
synonymously, `graphql-server-express`) main module, rather than exporting
it only from `./expressApollo`.

While the type would have still been available to someone using "connect"
middleware, this could yield less shake-win for connect developers who might be
tree-shaking, as they'd unnecessarily introduce the "express" middleware entry
points.
  • Loading branch information
abernix committed Mar 16, 2018
1 parent 8f18f26 commit f07ad2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions packages/apollo-server-express/src/expressApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {
} from 'apollo-server-core';
import * as GraphiQL from 'apollo-server-module-graphiql';

export type GraphQLOptions = GraphQLOptions;

export interface ExpressGraphQLOptionsFunction {
(req?: express.Request, res?: express.Response):
| GraphQLOptions
Expand Down
6 changes: 5 additions & 1 deletion packages/apollo-server-express/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Expose types which can be used by both middleware flavors.
export { GraphQLOptions } from 'apollo-server-core';

// Express Middleware
export {
ExpressGraphQLOptionsFunction,
ExpressHandler,
ExpressGraphiQLOptionsFunction,
graphqlExpress,
graphiqlExpress,
GraphQLOptions,
} from './expressApollo';

// Connect Middleware
export { graphqlConnect, graphiqlConnect } from './connectApollo';

0 comments on commit f07ad2f

Please sign in to comment.