apollo-server/packages/apollo-server-integration-testsuite
David Glasser 8b6b0161d1
Be consistent about where GraphQL queries are parsed
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.
2018-05-24 15:47:09 -07:00
..
src Be consistent about where GraphQL queries are parsed 2018-05-24 15:47:09 -07:00
.npmignore include readme for npm packages 2017-10-23 15:13:31 -07:00
package.json Be consistent about where GraphQL queries are parsed 2018-05-24 15:47:09 -07:00
tsconfig.json tsconfig: remove typeRoots from tsconfig and automatic retreival of node types 2018-05-21 15:29:37 -07:00