Commit graph

395 commits

Author SHA1 Message Date
Evans Hauser
012f37aed5
engine -> engineProxy in listen, fix engineLauncherOptions, and unrequired parameters optional (#1051)
engine -> engineProxy in listen, fix engineLauncherOptions, and make unrequired parameters optional
2018-05-11 15:54:22 -07:00
Evans Hauser
b9858df437
apollo-server-core: clarify context creation can be async in changelog 2018-05-11 15:54:22 -07:00
Evans Hauser
9099948e5c
apollo-server-core: run http options allows query to be an array 2018-05-11 15:54:22 -07:00
Evans Hauser
acae63cd4b
apollo-server-core: remove Promise wrapping in async function return values 2018-05-11 15:54:21 -07:00
Evans Hauser
8fe51be3ef
apollo-server-core: add warning to options creation failure if debugDefault enabled 2018-05-11 15:54:21 -07:00
Evans Hauser
ccb6eea934
apollo-server-core: enrichError not exported and moved formatter check to out of map 2018-05-11 15:54:21 -07:00
Evans Hauser
2781cc8831
apollo-server-core: remove unsued async from BaseServer's request function 2018-05-11 15:54:21 -07:00
Evans Hauser
e58db229df
changelogs: added to root and apollo-server-core 2018-05-11 15:54:20 -07:00
Evans Hauser
1f3103b5c7
apollo-server-core: use getOwnPropertyNames to stay es5 2018-05-11 15:53:19 -07:00
Evans Hauser
c4e3766475
apollo-server-core: add check for null property in ApolloError 2018-05-11 15:53:18 -07:00
Evans Hauser
0fe53a68da
apollo-server-core: capture context creation failure in GraphQL error 2018-05-11 15:53:18 -07:00
Evans Hauser
5aeb36f3d7
apollo-server-core: allow creation of context to be asynchronous 2018-05-11 15:53:17 -07:00
Evans Hauser
75e661e9b2
apollo-server-core: stronger typing on context in GraphQLServerOptions as a function 2018-05-11 15:53:17 -07:00
Evans Hauser
e0332bb164
apollo-server-core: added formatApolloError arguments to subscription callback 2018-05-11 15:53:17 -07:00
Evans Hauser
a7772a01fb
apollo-server-core: wrap error thrown by context construction in apollo error to add code 2018-05-11 15:53:17 -07:00
Evans Hauser
4645f200f2
apollo-server-core: apolloError places properties in root, so they are found in originalError 2018-05-11 15:53:17 -07:00
Evans Hauser
2a510039ec
apollo-server-core: internalFormatError to formatApolloError 2018-05-11 15:53:16 -07:00
Evans Hauser
f6eece6294
apollo-server-core: move logging into separate file 2018-05-11 15:53:16 -07:00
James Baxley
aaac1c8ff8
initial full beta 2018-05-11 15:53:16 -07:00
Evans Hauser
6239aa9562
apollo-server-core: remove merge artifact from changelog 2018-05-11 15:53:16 -07:00
Evans Hauser
cdf4c6860d
apollo-server-core: fix error printing and logging tests 2018-05-11 15:53:15 -07:00
Evans Hauser
8fdbfcd8c8
apollo-server-core: remove unused function printStackTrace 2018-05-11 15:53:15 -07:00
Evans Hauser
52b6f761f6
apollo-server-core: Add changelog 2018-05-11 15:53:15 -07:00
Evans Hauser
6b2e600a97
apollo-server-core: remove stack traces print and include response in logging function 2018-05-11 15:53:15 -07:00
Evans Hauser
1e78646440
apollo-server-core: add changelog with mock 2018-05-11 15:53:15 -07:00
Evans Hauser
ce7d72caab
apollo-server-core: add mocks 2018-05-11 15:53:15 -07:00
James Baxley
68dec79529
clean up and move pieces around 2018-05-11 15:53:14 -07:00
Evans Hauser
7b25a90a7e
apollo-server: add message, location, and path to formatError 2018-05-11 15:53:14 -07:00
Evans Hauser
d88100aca8
errors: change formatError to internalFormatError and fix when user defines formatError 2018-05-11 15:53:10 -07:00
Evans Hauser
cb09fef524
Errors: latest codes and add exports to the apollo-server package 2018-05-11 15:53:10 -07:00
Evans Hauser
35a5858125
errors: change INTERNAL_ERROR to INTERNAL_SERVER_ERROR, matching http errors 2018-05-11 15:53:09 -07:00
James Baxley
44a54123f9
use canary version 2018-05-11 15:53:08 -07:00
James Baxley
bdabe6259b
fix odd case in error handling 2018-05-11 15:53:08 -07:00
Evans Hauser
0e68e2ec4f
errors: send stack in debug, codes, make ApolloErrors 2018-05-11 15:53:07 -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
Renovate Bot
591b0f2cae chore(deps): update dependency typescript to v2.8.3 2018-04-20 10:02:15 +00:00
Jesse Rosenberger
9d0e7b6866
v1.3.5 2018-04-18 16:10:04 +03:00
David Glasser
cbb2b22570 core: fix HttpQueryRequest typing (#834)
This field generally gets used in `any` contexts, so the error didn't cause any compilation failures.
2018-04-18 16:00:44 +03:00
Steve Rice
083a1ee60e Avoid TypeError when querystring is present, but query missing (#964)
The express-graphql reference implementation [provides a check]
(2e27a73358/src/index.js (L201-L208))
to protect against cases where a GET request is made that does not
have a `query` parameter where the GraphQL query would be present.

Without this guard, graphql-js's `parse` will return `undefined`
for the `DocumentNode` since it has no document to read. Subsequently
passing this to `isQueryOperation` results in a `TypeError`, because
we are providing `undefined` where `getOperationAst` [expects to get
a DocumentNode](5fe39262a3/src/utilities/getOperationAST.js (L19)).

A new test file is added for `runHttpQuery`, as one previously did
not seem to exist.
2018-04-18 15:38:57 +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
Jesse Rosenberger
4cbaf4652d
Prettier for one change in #919. 2018-04-18 15:18:30 +03:00
Jamie Talbot
f387a1c824 Tighter context typing for GraphQLServerOptions (#919) 2018-04-18 14:16:45 +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
ebf892f8cc chore(deps): update dependency typescript to v2.8.1 2018-03-28 09:01:57 +00:00
Renovate Bot
273d5349b4 chore(deps): update dependency @types/graphql to v0.12.7 2018-03-28 07:03:40 +00:00
David Glasser
0f7c1c53b4
Update CHANGELOG for all releases back to v1.1.3 (#915)
There were many missing releases and bullet points as well as inaccurate
ones. For example, it was impossible to figure out that users of Hapi 16 who
want to use Apollo Cache Control needed to use precisely version 1.2.0 of
apollo-server-hapi (which wasn't even mentioned).

Link to CHANGELOG from all READMEs. Add READMEs for the graphql-server-*
packages. Add an explanation of our versioning system to the top of
CHANGELOG.md.
2018-03-27 09:22:13 -07: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