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

Apollo Server 2.0 without Docs #1063

Merged
merged 174 commits into from
Jun 1, 2018
Merged

Apollo Server 2.0 without Docs #1063

merged 174 commits into from
Jun 1, 2018

Conversation

evans
Copy link
Contributor

@evans evans commented May 11, 2018

This PR intends to land the revival of the apollo-server package as a new entry point for building GraphQL servers. apollo-server seeks to take an opinionated approach to building GraphQL services. The apollo-server-{framework} packages provide the ability to customize the behavior of the apollo-server for different environments or frameworks.

Apollo server also provides the tooling from graphql-tools and graphql-subscriptions, includes custom schema and service runtime additions (initially production validation rules for turning off introspection and more guidance around error handling).

This is the kickoff of a new generation of work on building production ready GraphQL services ♥️

The approach supersedes #979

Changes beta.2 -> beta.3

remove registerServer configuration from apollo-server's listen (#1090)
move healthcheck into variants (#1086)
Add file uploads, breaking requires removing scalar Upload from the typeDefs (#1071)

Changes beta.1 -> beta.2

ListenOptions:
engine -> engineProxy
port, host, and other http options moved under http key #1080

subscriptions moved to server.listen #1059
Add mocks to server constructor #1017
Add bodyParserConfig parameter to registerServer in apollo-server #1059 commit
Hapi variant #1058 #1082

renovate-bot and others added 30 commits May 11, 2018 15:53
glasser and others added 24 commits May 24, 2018 15:47
runQuery currently takes a `query` argument that is either a string or a
DocumentNode. This means that it's possible to accidentally support syntax we
don't mean to. For example, if you happen to send a JSON-serialized DocumentNode
over the wire, we'll happily execute that, and you'll believe you're using
GraphQL even though you really aren't --- until you try to use some other
GraphQL tool that expects to see the GraphQL query language rather than
graphql-js ASTs.

Additionally, GET requests parse their queries in runHttpQuery rather than
runQuery, leading to inconsistent error handling semantics on parse failures.

Simplify the runQuery API (which is technically exported though intended to be
mostly internal) to take in either a parsedQuery or a queryString argument. The
main use case for knowing about these parameters is if you're using formatParams
with OperationStore; its docs and tests have been updated to reflect this.

Stop parsing queries in runHttpQuery; instead, ensure we throw the right error
for mutations-over-GET by passing the error to throw into runQuery.

Stop accidentally supporting graphql-js ASTs on the wire --- but throw an
informative error when you do so.

This backwards-incompatible change is intended for apollo-server-core 2.0.
…ry-parse

Always only parse query in runQuery and don't accept AST over the wire
…erver (#1071)

* apollo-server-core: add file upload hooks and configuration

* apollo-server-core: make requestOptions and fileUploadsConfig public fields in ApolloServerBase

* apollo-server-express: initial fileuploads middleware

* apollo-server-hapi: initial file uploads middleware

* core: remove fileuploads from constructor and add merge capabilities

* express: add fileuploads to registerServer and single test

* hapi: add fileuploads schema merge to registerServer

* express: add check for EPIPE and ignore it due to upload server issue

* core: add scalar Upload to server construction
* core: runQuery accepts Request object that integrations create

* core: add changelog for Requst in runQuery

* adonis: correct request object passed to runQuery

* core: change convertHttpMessageToRequest to convertNodeHttpToRequest
AS2: Fix handling errors from context constructor and merged schemas
- Actually call validationDidStart and parsingDidStart.

- Use new graphql-extensions API which:
  - replaces fooDidEnd with a handler returned by fooDidStart
  - adds options to various methods
  - has a new willSendResponse method
  - requires you to construct the extension objects yourself (but make
    the external API for specifying extensions to ApolloServer be
    factories, because extensions are per request)

- Make a better effort at consistently calling end handlers even on error
Allow user-defined GraphQLExtensions, add apollo-engine-reporting
@evans evans merged commit 639b104 into version-2 Jun 1, 2018
@evans evans mentioned this pull request Jun 1, 2018
@evans evans changed the title Apollo Server 2.0 Apollo Server 2.0 without Docs Jun 2, 2018
@ghost ghost added the ⛲️ feature New addition or enhancement to existing solutions label Jun 2, 2018
@abernix abernix deleted the refactor-2.0 branch August 10, 2018 16:48
@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
⛲️ feature New addition or enhancement to existing solutions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants