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

Editing pass over the full exported API #6551

Merged
merged 1 commit into from Jun 9, 2022
Merged

Conversation

glasser
Copy link
Member

@glasser glasser commented Jun 9, 2022

  • The context function for startStandaloneServer now is passed an
    argument whose TS type only promises that req and res are core http
    objects rather than Express objects. (While we do currently implement
    startStandaloneServer using Express, this change means we do not
    have to commit to continuing that choice.)
  • Actually export expressMiddleware.
  • Move all publicly exported TypeScript-only types (ie, not actual
    classes) into externalTypes (other than types associated with
    specific plugins).
  • Rename ExpressContext to ExpressContextFunctionArgument
  • Get WithRequired from new @apollo/utils.withrequired (and don't
    export it).
  • Rename GraphQLServiceContext (the argument to serverWillStart) to
    GraphQLServerContext (matching GraphQLRequestContext)
  • Rename GraphQLServiceConfig to GatewayLoadResult and remove the unused
    schema field.
  • Don't export the various interfaces like
    ApolloServerOptionsWithSchema publicly.
  • Generally reduce depth of imports; eg, in tests import from the top
    level when possible, to make it clear when an import actually has to
    be deep because it's not part of the external API
  • ApolloServer._start is now private rather than protected (no
    subclasses!)
  • In tests, simplify makeGatewayMock to take some configuration as an
    argument rather than a later resolveLoad call; don't make this mock
    handle load() throwing, which is implemented directly in the one
    test that needed it.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 9, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0118bb4:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

- The `context` function for `startStandaloneServer` now is passed an
  argument whose TS type only promises that req and res are core `http`
  objects rather than Express objects. (While we do currently implement
  `startStandaloneServer` using Express, this change means we do not
  have to commit to continuing that choice.)
- Actually export `expressMiddleware`.
- Move all publicly exported TypeScript-only types (ie, not actual
  classes) into `externalTypes` (other than types associated with
  specific plugins).
- Rename `ExpressContext` to `ExpressContextFunctionArgument`
- Get `WithRequired` from new `@apollo/utils.withrequired` (and don't
  export it).
- Rename GraphQLServiceContext (the argument to serverWillStart) to
  GraphQLServerContext (matching GraphQLRequestContext)
- Rename GraphQLServiceConfig to GatewayLoadResult and remove the unused
  `schema` field.
- Don't export the various interfaces like
  `ApolloServerOptionsWithSchema` publicly.
- Generally reduce depth of imports; eg, in tests import from the top
  level when possible, to make it clear when an import actually has to
  be deep because it's not part of the external API
- ApolloServer._start is now private rather than protected (no
  subclasses!)
- In tests, simplify makeGatewayMock to take some configuration as an
  argument rather than a later resolveLoad call; don't make this mock
  handle `load()` throwing, which is implemented directly in the one
  test that needed it.
@glasser
Copy link
Member Author

glasser commented Jun 9, 2022

@trevor-scheer Merging while you're out but this will definitely enjoy your review!

@glasser glasser merged commit 3dfad5f into version-4 Jun 9, 2022
@glasser glasser deleted the glasser/v4-api-overview branch June 9, 2022 19:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant