Commit graph

75 commits

Author SHA1 Message Date
Evans Hauser
9af856c2c8
Typescript Improvements and esModuleInterop fix (#1210)
* add string input to gql tag

* remove esModuleInterop, tested locally

* change IMPORT_FUNCTION to something real

* fix the rest of the tests
2018-06-20 16:21:50 -07:00
Evans Hauser
cba05d9567
remove operation store module because of apq's 2018-06-15 11:16:37 -07:00
Evans Hauser
9588468875
v2.0.0-rc.0 2018-06-14 23:18:07 -07:00
David Glasser
d006d4d83d v2.0.0-beta.11 2018-06-14 12:00:21 -07:00
David Glasser
3fccd43bae simplify upload enhanceSchema, rename to installSubscriptionHandlers
also export graphql-tools and graphql-subscriptions from apollo-server-core
2018-06-14 11:57:30 -07:00
David Glasser
1707967518 Specify full path in tsconfig imports
Emacs tide mode seems to require
this (https://github.com/ananthakumaran/tide/pull/238 is supposed to have fixed
it but it didn't work?)
2018-06-14 11:57:30 -07:00
Evans Hauser
9d853f4be4 move ApolloServer tests into integration tests from core 2018-06-14 11:57:30 -07:00
David Glasser
ddc589d996 v2.0.0-beta.10 2018-06-13 16:07:41 -07:00
David Glasser
eb0ae81cfa Update integration test suite to test ApolloServer
Fix some connect bugs.
2018-06-13 15:27:44 -07:00
Evans Hauser
e66f6db413
fix: support Node 6 (#1171) 2018-06-13 14:56:09 -07:00
David Glasser
e4a6e873f8 Remove graphiql support
ApolloServer builds in graphql-playground rather than graphiql, so we no longer
provide middleware for serving GraphiQL.

If this turns out to be an unpopular choice, we can always add support for
graphiql instead of graphql-playground back in later.

We prefer graphql-playground because it allows you to enter HTTP request
headers, view query history, and explicitly supports graphql@0.13.
2018-06-13 14:00:51 -07:00
David Glasser
519b6fd056 v2.0.0-beta.9 2018-06-13 11:47:30 -07:00
Evans Hauser
db8eba871f
v2.0.0-beta.8 2018-06-12 17:54:55 -07:00
David Glasser
df8e487368 v2.0.0-beta.7 2018-06-11 18:45:23 -07:00
David Glasser
3e93524ac3 v2.0.0-beta.6 2018-06-11 15:54:01 -07:00
Evans Hauser
a7cd3a43e8 Apollo Server 2:Automatic Persisted Queries (#1149) 2018-06-11 15:44:20 -07:00
Martijn Walraven
4a068cff74 Add engines field with node >= 8 in package.json 2018-06-11 13:21:51 +02:00
Martijn Walraven
1e1b49ec29 Update devDependencies, including typescript 2018-06-11 12:13:03 +02:00
Martijn Walraven
b5eab35807 Remove duplicate common dependencies to avoid Lerna warnings 2018-06-11 11:57:00 +02:00
Evans Hauser
4c6352aad7
v2.0.0-beta.5 2018-06-07 14:50:13 -07:00
Evans Hauser
5079246bc4
apollo-server,core,hapi,express: bump package to newest beta.4 2018-06-04 10:16:54 -07:00
David Glasser
836616bd04 Turn on noUnusedLocals and noUnusedParameters (#1126) 2018-06-01 15:16:16 -07:00
Evans Hauser
ec7394d1b3 apollo-server,core,hapi,express: bump package to newest beta 2018-06-01 12:34:49 -07:00
Evans Hauser
8c92c1a7d8
integration-testsuite: add error on AST passed to server as query 2018-05-24 16:38:37 -07:00
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
Evans Hauser
84e763358e
package.json: remove node and graphql types from root and unnecessary variants 2018-05-21 15:31:57 -07:00
Evans Hauser
072aef410b
tsconfig: remove typeRoots from tsconfig and automatic retreival of node types 2018-05-21 15:29:37 -07:00
Evans Hauser
aad7c39001
build: update dependencies and remove extra node typings 2018-05-20 03:52:54 -07:00
Evans Hauser
c83efaca7c
apollo-server-integration-testsuite: fix tests for apollo-server 2 2018-05-11 15:53:18 -07:00
David Glasser
b32e89c060 v1.3.6 2018-04-24 11:35:14 -07:00
David Glasser
e2df79d06c core: return PersistedQueryNotSupported for Apollo Persisted Queries (#982)
Apollo Persisted Queries is a standard for sending queries as short hashes
instead of full strings, designed to work well with GET requests. It is
implemented by servers including the Apollo Engine Proxy, and by the
apollo-link-persisted-query client.

A common configuration is to set up persisted queries on production servers but
not in development. It is still convenient to leave apollo-link-persisted-query
always on, though. While apollo-link-persisted-query can detect that servers
don't support PQs, it works better if the server actually says it doesn't
support the PQ, instead of trying to process a request without a query and
potentially printing a confusing stack trace.  This commit makes apollo-server
directly return PersistedQueryNotSupported instead of allowing confusing stack
traces to occur.
2018-04-24 06:29:07 -04:00
Jesse Rosenberger
9d0e7b6866
v1.3.5 2018-04-18 16:10:04 +03:00
Jesse Rosenberger
0a103ef5bd
Stop violating types by returning assertions from Mocha tests. (#972)
This change was introduced by the changes in apollographql/apollo-server#802
but first showed its head in apollographql/apollo-server#908.  The reason that
violations in new type definitions aren't being found until subsequent PRs
isn't entirely clear but, ignoring that CI-related annoyance, the problem
itself here is very concrete.

It traces back to a major version update to `@types/mocha` via [Exhibit A],
which makes it unacceptable to return anything besides a `Promise` or
_nothing_ from a Mocha test factory.

I agree with this change in principle, since generally speaking there can be
multiple `expect` statements in each test and there is no particular reason
that the last one's value should be getting returned as Mocha doesn't do
anything functional with it.

More than anything, this seems like an artifact of an ESLint rule which
mandated that the last value in a function be returned, à la CoffeeScript or
other languages.

This will fix the failing tests on apollographql/apollo-server#908 and other
PRs currently in-flight.

Exhibit A: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24301
2018-04-18 15:37:47 +03:00
David Glasser
bd2504e04b v1.3.4 2018-03-28 13:57:11 -07:00
David Glasser
7d1165f1e0
All: allow cacheControl: {defaultMaxAge: 5}. (#922) 2018-03-28 13:56:22 -07:00
Renovate Bot
273d5349b4 chore(deps): update dependency @types/graphql to v0.12.7 2018-03-28 07:03:40 +00:00
Jesse Rosenberger
19d04ff7f7
v1.3.3 2018-03-26 17:20:44 +03:00
Renovate Bot
a4e2e3e893 chore(deps): update dependency @types/graphql to v0.12.6 2018-03-23 07:02:17 +00:00
renovate[bot]
5eae20e92f chore(deps): update dependency @types/graphql to v0.12.5 (#887) 2018-03-16 14:06:15 +02:00
Renovate Bot
d50b6b6fb2 chore(deps): update dependency graphql to v0.13.1 2018-03-13 16:01:14 +00:00
Sashko Stubailo
281392c3f0 Update to graphql@0.12 (#726)
* Update peer deps and tests for 0.12
* v1.3.2
2018-03-13 17:10:37 +02:00
Laurin Quast
df51fd90da Setup prettier (#724)
* Setup prettier and precommit hooks

* Format code with prettier

* Use husky because it works...

* Move prettier config to .prettierrc file

* Implement fixing markdown file formatting when running lint-fix script

* Format markdown files

* Add .json file formatting

* Fixes json file formatting

* Add pretteir linting step

* Remove tslint

* Use gitignore for prettier

* Fix linting errors

* Ignore submodule folder
2018-01-08 15:08:01 -08:00
Martijn Walraven
6685ecb458 v1.3.1 2017-12-18 07:34:48 +01:00
Renovate Bot
0c439cb35f chore(deps): update dependency @types/graphql to v0.11.7 2017-12-12 20:31:42 +00:00
Martijn Walraven
9ba34306ed v1.3.0 2017-12-12 09:45:49 +01:00
Benedict Hobart
62c397eecc Fix shallow cloning of context when executing a batch request (#679)
This fixes the default behavior for class-based contexts by also cloning the prototype, and it allows you to customize per-operation behavior by passing in a function as context.
2017-12-12 08:09:01 +01:00
Alessandro Segala
037c13e5f3 Update to Hapi 17 (#687)
Note: TS typings for Hapi 17 are not available yet, so the types packages have been temporarily removed
2017-12-08 09:04:12 +01:00
Martijn Walraven
3fecfcd321 v1.2.0 2017-10-24 09:14:51 -07:00
Martijn Walraven
65a642506d v1.2.0-pre.1 2017-10-24 09:09:08 -07:00
Nick Nance
47335f726d include readme for npm packages 2017-10-23 15:13:31 -07:00