Commit graph

236 commits

Author SHA1 Message Date
Jesse Rosenberger
f1a9e39317
Update CHANGELOG.md in preparation for v2.4.8. 2019-02-26 16:20:05 +02:00
Jesse Rosenberger
36f2a156f1
Update CHANGELOG.md to include reference to #1882.
Closes https://github.com/apollographql/apollo-server/issues/1882.
2019-02-26 13:11:12 +02:00
Jesse Rosenberger
6fd7ea7a7f
Update CHANGELOG.md in preparation for v2.4.7. 2019-02-26 12:59:32 +02:00
Chang Wang
1ef592adeb Fix: Remove incorrect cors option type from apollo-server-express's constructor (#2373)
* Fix: Remove incorrect cors option type from apollo-server-express's constructor

https://github.com/apollographql/apollo-server/pull/2330#discussion_r259773834

* update changelog

* Update CHANGELOG.md
2019-02-25 17:32:18 +02:00
Jesse Rosenberger
5bd4438d14 Update CHANGELOG.md in preparation for v2.4.6. 2019-02-22 07:08:09 +00:00
Chang Wang
739682053e Update CHANGELOG.md in preparation for v2.4.5. 2019-02-21 14:32:55 -05:00
KATT
f0a3c69635 export interface ExpressContext 2019-02-21 15:46:07 -03:00
Chang Wang
7da1a9dfa5 Update CHANGELOG.md in preparation for v2.4.4. 2019-02-21 12:59:28 -05:00
Chang Wang
a4ebadc876
Type parameters for context function separately from the context it produces (#2350)
* Add AS constructor with context usage to tests

* fix(typing): Context template type should be 'object' and not 'any'

```context?: ContextFunction<ExpressContext, any> | Context<any>;```
is
```context?: ContextFunction<ExpressContext, any> | any;```
which is
```context?: any;```

https://github.com/Microsoft/TypeScript/issues/18568

Since the ContextFunction<...> part is ignored, no type hinting will be provided when a function is passed to `context`. We don't really mean `any`, we mean an object with any shape, so we should use `object` instead

* fix(typing): type ContextFunction params separately from resulting context object

* Update changelog

* rename: ContextContent -> ProducedContext
2019-02-21 12:49:04 -05:00
Chang Wang
8850e0f7ed
Add more accurate typings to formatError (#2343)
* Type formatErrors function to specify that it accepts and returns ApolloError

* Update changelog

* type(formatErrors): accept GraphQLError, return GraphQLFormattedError

* update changelog
2019-02-21 09:10:13 -05:00
Jesse Rosenberger
8303230697
Update CHANGELOG.md in preparation for v2.4.3. 2019-02-20 18:36:24 +02:00
Jesse Rosenberger
0d4fb48d9a
Merge branch 'master' into patch-1 2019-02-20 13:09:50 +02:00
Jesse Rosenberger
537e55c38d
Update CHANGELOG.md for #2230. 2019-02-20 12:49:57 +02:00
Chang Wang
63089961f5 Provide more accurate types for apollo-server-express's ContextFunction (#2330)
* typing: context function could return value synchronously

* Create ApolloServerExpressConfig type that has req and res in context

* Have apollo-server-express's constructor also use the express-specific config

* Update changelog
2019-02-19 20:00:12 +02:00
Ralph
2f773625c0 apollo-server-koa: Respond to OPTIONS (#2288)
Closes #2253
2019-02-19 18:01:17 +02:00
Jesse Rosenberger
5719cd4a60
Update CHANGELOG.md in preparation for v2.4.2 release. 2019-02-14 15:21:14 +02:00
Jesse Rosenberger
fce72b2517
Update CHANGELOG.md for apollo-server-fastify release. 2019-02-14 15:09:25 +02:00
Jesse Rosenberger
8ac2884cfa
Merge branch 'master' into re-stage-pr-1971 2019-02-14 15:01:00 +02:00
Jesse Rosenberger
0c83e7b4ad
Update CHANGELOG.md to put #2316 into vNEXT, not v2.4.1 where it wasn't. 2019-02-14 14:35:34 +02:00
Trevor Scheer
4f24edc1f6 Migrate apollo-graphql package to apollo-tooling repo (#2316)
The purpose of this PR is to remove the `apollo-graphql` package from this repository, to be added to `apollo-tooling` instead.

https://github.com/apollographql/apollo-tooling

Ref: https://github.com/apollographql/apollo-tooling/pull/1018
2019-02-14 12:41:58 +02:00
Ben Newman
a46560b05e
Update CHANGELOG.md for changes included in version 2.4.1. 2019-02-12 16:08:47 -05:00
Chang Wang
bf120018bf Await on graphql.execute() before calling executionDidEnd handler (AS-59) (#2298)
* Wait on graphql.execute() before calling end handler

* Update changelog
2019-02-12 20:34:56 +02:00
Jacob Marshall
e3070a51d6 Correct Azure Functions type definitions (#2287)
* Rename azureFunctions.d.ts to azureFunctions.ts

See https://github.com/apollographql/apollo-server/issues/2085#issuecomment-449686772

* Update CHANGELOG.md
2019-02-12 18:28:12 +02:00
Jesse Rosenberger
b4df18b31a
Merge branch 'master' into re-stage-pr-1971 2019-02-08 12:48:41 +02:00
Jesse Rosenberger
5065360cdb
Update CHANGELOG.md to remove vNEXT from v2.4.0 header.
This was inadvertently left in place as I didn't run into the usual
merge-conflict that I usually do on the CHANGELOG.md which is my natural
ergonomic which usually leads me to fixing it.  Apologies!
2019-02-08 12:17:57 +02:00
Jesse Rosenberger
44358efa9b
Adjust CHANGELOG.md entry for #2111. 2019-02-07 12:56:33 +02:00
Jesse Rosenberger
e971bdf8b4
TEMP: Revert "feat(Fastify) Apollo server Fastify integration #626 (#1971)"
This TEMPORARILY reverts commit 069110b353,
which was the result of the work done in #1971 by @rkorrelboom.

Unfortunately, we need to put this on ice while we wait for movement on a
package naming conflict.  The dialog surrounding this is under way, as
I've explained in the PR:

https://github.com/apollographql/apollo-server/pull/1971#issuecomment-456817749

I'm excited to re-land this in an upcoming version, but there's no reason to
block the 2.4.0 release for it right now.

I will open a new PR with the work from #1971 in due time.
2019-02-07 12:56:03 +02:00
Jesse Rosenberger
f4dc9130a3
Remove blank line in CHANGELOG.md from merge. 2019-02-07 12:41:36 +02:00
Jesse Rosenberger
60b8bca6da
Merge branch 'master' into release-2.4.0 2019-02-07 12:40:37 +02:00
Jesse Rosenberger
4c1b56aca0
Update CHANGELOG.md 2019-02-07 11:44:26 +02:00
Jesse Rosenberger
5666235119
Merge branch 'master' into release-2.4.0 2019-02-06 12:06:02 +02:00
Chris Airey
e8e49026dd Serialize arrays as JSON on fetch in RESTDataSource 2019-02-05 03:38:21 -05:00
Jesse Rosenberger
03283f9ad3
Merge branch 'master' into release-2.4.0 2019-01-29 12:10:13 +02:00
Jesse Rosenberger
3d106039b6
Update CHANGELOG.md in preparation for v2.3.3 release. 2019-01-29 11:39:28 +02:00
Jesse Rosenberger
db39aa5604
Remove willStart from apollo-server, already called via …-express. (#2239)
* Remove `willStart` from `apollo-server`, already called via `...-express`.

When the request pipeline was initially introduced, the integrations
had yet to be updated to call the new life-cycle events.  Now, the
integrations have all caught up, but `apollo-server` is still calling
`willStart`, despite the fact that its dependency which provides the actual
server implementation — `apollo-server-express` – is _also_ calling it,
resulting in double invocation of this event.

I suspect some follow-up work should guard against this possibility, but for
now this should remove the duplication.

* Update CHANGELOG.md for #2239.

Ref: https://github.com/apollographql/apollo-server/pull/2239
2019-01-29 11:39:08 +02:00
Kurt Mackey
cd674aae72 More strict check for node version for graphql-upload (#2235)
Stop traversing the `graphql-upload` module tree in all non-Node.js environments, to support subset-V8 runtimes like Fly.io.
2019-01-29 11:36:40 +02:00
Jesse Rosenberger
8a9d5cf828
Polish CHANGELOG.md prior to v2.3.2 release. 2019-01-25 18:46:11 +02:00
Jesse Rosenberger
18d9041db7
Don't write to persisted query cache until execution will begin. (#2227)
Since we already write to the persisted query cache asynchronously (and
intentionally do not await the Promise) this won't have any affect on the
current behavior of when the persisted query cache is written to in the
event of an executable request, but if an operation comes in and doesn't
parse or validate, we'll avoid wasting cache space on an operation that will
never execute.

Additionally, in a similar light, if a plugin throws an error which stops
execution, we can avoid the side-effect of writing to the persisted query
cache.

In terms of the APQ behavior, while this could cause additional round-trips
for a client which repeatedly sends an invalid operation, that operation is
never going to successfully finish anyway.  While developer tooling will
help avoid this problem in the first place, this refusal to store an invalid
operation in the APQ cache could actually help diagnose a failure since the
full operation (rather than just the SHA256 of that document) will appear
in the browser's dev-tools on the retry.

If we're looking to spare parsing and validating documents which we know are
going to fail, I think that's going to be a better use of the (new)
`documentStore` cache (#2111), since its in-memory and can accommodate a
more complex data structure which includes the validation errors from the
previous attempt which will, of course, be the same when validating the same
operation against the same schema again.  As the PR that introduced that
feature shows, sparing those additional parses and validations (cached APQ
documents still needs to be parsed and validated, currently) will provide a
more successful performance win overall.

Ref: https://github.com/apollographql/apollo-server/pull/2111
2019-01-25 18:01:15 +02:00
Jesse Rosenberger
e82bccfedf
Fix CHANGELOG.md for #1971, now tentatively in 2.4.x. 2019-01-23 15:48:01 +02:00
Remy
069110b353 feat(Fastify) Apollo server Fastify integration #626 (#1971)
* feat(fastify) Apollo Fastify server integration resolve #626

* feat(fastify) Use createHandler instead of applyMiddleware #626

* feat(fastify) Fix integration test for node 10 #626

* feat(fastify) Update README's with fastify createHandler interface #626

* feat(fastify) Implement the fastify createHandler as a synchronous method #626

* (fastify) Tweaks to re-align with the parallel work in #2054.

* (fastify): Use port 9999 rather than 8888 for tests.  Because Gatsby.

This specific port per integration is pretty brittle to begin with, but it
does work.  Currently, the fact that it works is facilitated by the fact
that most people don't use 5555 (Hapi) and 6666 (Express) for anything.

That said, the ever-popular Gatsby uses 8888 by default, so let's use 9999!

* (fastify) Remove duplicative assertion in upload initialization.

* (fastify) Implement fastify upload middleware

* (fastify) Fix linting issues

* (fastify) Update package-lock
2019-01-23 15:43:47 +02:00
Jesse Rosenberger
a14eddfdc5
Merge branch 'release-2.4.0' into HEAD 2019-01-23 15:15:11 +02:00
Jesse Rosenberger
ea7da3a38c
Merge branch 'master' into abernix/cache-parsed-validated 2019-01-14 20:39:36 +02:00
Remy Korrelboom
bacdeae80d feat(fastify) Apollo Fastify server integration resolve #626 2019-01-02 14:24:47 +01:00
wtgtybhertgeghgtwtg
ccba8c87da Switch json-stable-stringify to fast-json-stable-stringify. (#2065)
* refactor: switch `json-stable-stringify` to `fast-json-stable-stringify`

* chore: drop `@types/json-stable-stringify`

* Update CHANGELOG.md for #2065.
2018-12-19 20:06:17 +02:00
Jesse Rosenberger
88a294b178
Add CHANGELOG.md for #2111 (parse/validate document store/cache). 2018-12-18 17:12:23 +02:00
Jesse Rosenberger
7797dcc5ab
Update CHANGELOG.md 2018-12-17 13:21:03 +02:00
Jesse Rosenberger
0bf209a5fb
Update CHANGELOG.md
For increased awareness: https://github.com/apollographql/apollo-server/issues/2099
2018-12-17 13:20:12 +02:00
Jesse Rosenberger
27e98a5598
Update CHANGELOG.md prior to releasing v2.3.1.
Closes: https://github.com/apollographql/apollo-server/issues/2092
Fixed by: ccf935f976
2018-12-13 20:55:55 +02:00
Jesse Rosenberger
522cd6bf75
Update CHANGELOG.md for 2.3.0 release.
Also removes inadvertent 2.2.7-alpha.0 leftover from merge.
2018-12-13 15:28:12 +02:00
Jesse Rosenberger
ad42402954
Merge branch 'release-vNEXT' 2018-12-13 15:26:32 +02:00