Commit graph

789 commits

Author SHA1 Message Date
Martijn Walraven
d1947de9b8 Only take full request instead of convenience arguments 2018-07-16 18:43:54 -07:00
Evans Hauser
e04a570f7e
pin internal dependencies (#1361) 2018-07-16 16:15:10 -07:00
Evans Hauser
fa6c973f36
Fix and Export Extension and Playground Types (#1360)
* export playground types

* make playground configuration recursively partial
2018-07-16 15:49:20 -07:00
Martijn Walraven
8a588929d4 Add optional cf property to RequestInit 2018-07-16 13:54:30 -07:00
Martijn Walraven
a59167ddef Add optional url property to ResponseInit 2018-07-16 13:53:50 -07:00
Yichang Liu
cd1a4630f8 fix: add url for cached response (#1355) 2018-07-16 13:47:12 -07:00
renovate[bot]
3b3c50a1ab chore(deps): pin dependencies (#1346) 2018-07-16 09:56:51 -07:00
Renovate Bot
c836c01c2f chore(deps): update dependency multer to v1.3.1 2018-07-14 08:04:20 +00:00
Renovate Bot
62cadcd405 chore(deps): update dependency koa to v2.5.2 2018-07-14 06:30:43 +00:00
Renovate Bot
159b09f531 chore(deps): update dependency hapi to v17.5.2 2018-07-14 04:10:45 +00:00
Evans Hauser
db6fdd32f1
Publish
- apollo-cache-control@0.2.0-rc.1
 - apollo-datasource-rest@2.0.0-rc.8
 - apollo-datasource@2.0.0-rc.8
 - apollo-engine-reporting@0.0.0-rc.2
 - apollo-server-caching@2.0.0-rc.8
 - apollo-server-cloudflare@2.0.0-rc.8
 - apollo-server-core@2.0.0-rc.8
 - apollo-server-env@2.0.0-rc.8
 - apollo-server-errors@2.0.0-rc.8
 - apollo-server-express@2.0.0-rc.8
 - apollo-server-hapi@2.0.0-rc.8
 - apollo-server-integration-testsuite@2.0.0-rc.8
 - apollo-server-koa@2.0.0-rc.8
 - apollo-server-lambda@2.0.0-xrc.8
 - apollo-server-memcached@2.0.0-rc.8
 - apollo-server-micro@2.0.0-rc.8
 - apollo-server-redis@2.0.0-rc.8
 - apollo-server@2.0.0-rc.8
 - apollo-tracing@0.2.0-rc.1
 - graphql-extensions@0.1.0-rc.2
2018-07-13 17:49:39 -07:00
Alessio Dionisi
3ba5d0a89f Apollo Server 2.0: AWS Lambda, handle OPTIONS method (#1344)
* handle OPTIONS http method

* readme updated

* remove endpoint from playground options

* lambda fix cors for playground and readme typo

* Revert "remove endpoint from playground options"

This reverts commit d5799846b0d99148f201e532e6eb9d408ab618e1.
2018-07-13 17:45:17 -07:00
Evans Hauser
467b224219
fix hapi readme 2018-07-13 13:35:53 -07:00
Evans Hauser
b7c5ceaade
fix export of hapi middleware 2018-07-13 13:23:45 -07:00
Evans Hauser
c00918b868
remove apollo-server-fastify 2018-07-13 13:20:39 -07:00
Evans Hauser
c3cee59985
Merge branch 'master' into version-2 2018-07-13 13:20:00 -07:00
Evans Hauser
170f072f96
bring version-2 up to date 2018-07-13 13:14:19 -07:00
Evans Hauser
bc84547f9b
v1.4.0 2018-07-13 11:46:55 -07:00
Aditya Pratap Singh
8d5baecc52 feat(fastify): Integrate apollo-fastify plugin (#1013)
* Integrate apollo-fastify plugin #626

* #626 Fix typescript issues

* #626 Update changelog

* #626 Update README

* #626 Fix the breaking tests

* #626 Fix code review comments

* #626 Run Hapi tests only for node 8 and 9

* #626 Run Hapi tests only for node 8 and 9

* #626 Commit package.lock in working state

* #626 Use npm instead of yarn for node 4

* Revert package-lock and circle ci test job steps

* #626 Bump the version
2018-07-13 11:37:44 -07:00
Najeeb Rifaat
d3aedd31e6 fix(hapi16_support): add hapi 16 next() invocation [closes #744] (#743)
* chore(hapi16_support): add hapi 16 next() invocation

* run lint fix

* update changelog
2018-07-13 11:30:47 -07:00
Evans Hauser
d4a8e1ac7f
Throw error in applyMiddleware for vanilla apollo-server (#1345)
applyMiddleware is not a public api for apollo-server, so it should not
be used an direct people to the apollo-server-express integration.
2018-07-13 10:50:50 -07:00
Garanzha Dmitriy
8bcb66622d Add skipValidation option. (#839)
* Don't validate if query is already an AST.

* Skip validation option.
2018-07-13 10:44:10 -07:00
Jake Dawkins
b5039f3aaf Added option to disable rewriting URL for GraphiQL (#1047)
* added option to disable rewriting url for graphiql

* updated docs

* added link to PR in changelog
2018-07-13 10:25:23 -07:00
Evans Hauser
990d915aec
Apollo Server 2: Remove formatParams (#1331)
* remove formatParams

* remove formatParams from documentation

* check for valid query string after persisted query mapping

* fix sentence about different logging and label extensions as experimental

* mark graphql-extensions as more experimental
2018-07-13 09:44:13 -07:00
Evans Hauser
78dcf4fccf
remove calculate headers as a function (#1337) 2018-07-13 09:43:28 -07:00
Renovate Bot
f6e48bb9c0 chore(deps): update dependency koa to v2.5.2 2018-07-12 08:48:38 +00:00
Adam Zionts
11b867114e Move gui option into constructor and use playground (#1297)
* Add a wider diversity of `gui` options

Although I know we want to remain less tied to the GraphQL Playground
GUI options, we definitely want to support a wider variety of options to
be passed in. This adds support for specifying partial options either
statically or dynamically for the gui, which can be extended to allow
for a wider array of guis than only GraphQL playground.

* Add boolean option and configuration for tabs

* move gui setting into ApolloServer Constructor

* document playground configuration in the constructor

* update playground types and fixed micro + koa integrations

* change gui to playground

* docs: change gui to playground

* fix logic for playground creation
2018-07-11 15:42:00 -07:00
Martijn Walraven
f055d282e0 Extract abstract DataSource superclass into apollo-datasource package 2018-07-11 15:29:46 -07:00
C. T. Lin
299018fd5c [apollo-server-koa] use exported bodyParser.Options type instead of inferred type (#1334) 2018-07-11 15:00:16 -07:00
Martijn Walraven
54a8fac80b RESTDataSource: Serialize request bodies that have a toJSON method as JSON 2018-07-11 14:31:32 -07:00
uosl
1022ae17ed RESTDataSource: Do not serialize body values that aren't objects (#1316) 2018-07-11 13:53:56 -07:00
Martijn Walraven
c200df05d3 RESTDataSource: Add data to errors thrown for error responses
Closes #1311.
2018-07-11 13:49:35 -07:00
Evans Hauser
de4760ba3b
Expose Cors option from vanilla ApolloServer constructor (#1335)
* add cors option to apollo-server's constructor

* docs: add cors option to costructor for apollo-server

* expose CorsOptions from vanilla and express integrations

* Update apollo-server.md
2018-07-11 13:46:51 -07:00
Gauthier Rodaro
ecc56690df RESTDataSource: add didReceiveResponse method (#1325) 2018-07-11 06:17:03 -07:00
Radu Achim
e83dcbc433 Round the ttl to an integer so that redis doesn't b0rk (#1323)
Fixes #1306.
2018-07-10 09:50:06 -07:00
Prosper Otemuyiwa
61b4939327
Enable GraphQLUpload for Apollo Server 2.0 (#1322)
* export GraphQLUpload

* fix GraphQLScalar typing
2018-07-10 05:36:34 +01:00
Evans Hauser
13b796fe34
Publish
- apollo-cache-control@0.2.0-rc.0
 - apollo-datasource-rest@2.0.0-rc.7
 - apollo-engine-reporting@0.0.0-rc.1
 - apollo-server-caching@2.0.0-rc.7
 - apollo-server-cloudflare@2.0.0-rc.7
 - apollo-server-core@2.0.0-rc.7
 - apollo-server-env@2.0.0-rc.7
 - apollo-server-errors@2.0.0-rc.7
 - apollo-server-express@2.0.0-rc.7
 - apollo-server-hapi@2.0.0-rc.7
 - apollo-server-integration-testsuite@2.0.0-rc.7
 - apollo-server-koa@2.0.0-rc.7
 - apollo-server-lambda@2.0.0-rc.7
 - apollo-server-memcached@2.0.0-rc.7
 - apollo-server-micro@2.0.0-rc.7
 - apollo-server-redis@2.0.0-rc.7
 - apollo-server@2.0.0-rc.7
 - apollo-tracing@0.2.0-rc.0
 - graphql-extensions@0.1.0-rc.1
2018-07-09 19:32:59 -07:00
Evans Hauser
e29f8048e4
Enable engine reporting in Lambda (#1313)
* add disableInterval option to engine reporting

* set engine options for lambda

* lambda: add comment on constructor

* lambda: update readme typo and include callout to use graphql.js

* disableInterval -> sendReportsImmediately

* use sendReportsImmediately correctly and fix compilation

* uses new Header to fix different header combination, fixes #1301

* add apollo-server-env dependency

* fix logic error in engine reporting
2018-07-09 19:29:05 -07:00
Martijn Walraven
f551e2bb44 Use apq prefix for persisted query caching 2018-07-09 19:28:21 -07:00
Martijn Walraven
9e60f42845 Use main cache for persisted queries by default 2018-07-09 19:25:09 -07:00
Martijn Walraven
f8feca870a Move lru-cache dependency to apollo-server-caching 2018-07-09 16:51:30 -07:00
Martijn Walraven
d01b18a704 Update GraphQL Playground version 2018-07-09 16:35:30 -07:00
C. T. Lin
dbaa465646 Apollo Server 2 Koa integration (#1282)
* koa integration

* use koa-bodyparser v3 for node 6 support

* use middlewareFromPath instead of koa-router

* use async/await in koa fileUploadMiddleware
2018-07-06 13:52:56 -07:00
Hugh Willson
c356bcf3f2 Apollo Server 2 Micro integration (#1279)
* Initial basic Micro integration

* Wire up health check capabilities

* Add playground support; Refactoring

* Add custom path support

* Add file upload support

* Add subscription support

* Documentation and formatting updates

* Wire up tests

* Add Node 10 workaround for file upload testing

* Code review changes (docs, naming, formatting)

* Adjust exports to line up with other integrations

* micro: add graphql to npm install and lines to highlight in docs
2018-07-05 11:40:15 -07:00
Martijn Walraven
94d4d4968c Use for-of loops instead of standard for loops 2018-07-04 22:31:55 +02:00
Martijn Walraven
4793c5ad7e Rename apollo-cache-control-js and apollo-tracing-js and unify configs 2018-07-04 22:26:28 +02:00
Martijn Walraven
4114bc5a0b Enable strict typing for apollo-server-core and fix issues 2018-07-04 21:31:55 +02:00
Danilo Bürger
73a5da149a Replaced RESTDataSource with generic DataSource typing (#1293) 2018-07-04 09:26:39 +02:00
Evans Hauser
19c8adf019
Import apollo-cache-control-js (#1294)
* Initial commit

* Add .npmignore to avoid ignoring lib when publishing

* 0.0.2

* Update graphql-extensions dependency to 0.0.2

* 0.0.3

* Reorganize code and add tests

* 0.0.4

* Add tests and reorganize code

* 0.0.5

* Update dependency to graphql-extensions 0.0.4

* 0.0.6

* Update graphql-extensions dependency and downgrade TS target

* 0.0.7

* Update README

* Update README

* Update README

* Update README

* Add import instructions for TypeScript to README (#7)

* Add cache hints when the directive is defined on interfaces (#10)

* Increase version range for `graphql` peerDependency. (#12)

* 0.0.8

* Update dependencies

* 0.0.9

* [apollo-bot] Update the Issue/PR Templates with auto label (#13)

* [apollo-bot] Update the Templates with docs label (#15)

* Add cache hints to info.cacheControl (#16)

This exposes the `cacheControl` hints on the schema, to the resolvers at runtime.

* Update `graphql` peer dependency range to allow 0.13.x.

* dev: Update TypeScript to latest version, v2.7.2.

* dev: Update jest & dependencies to latest versions.

* dev: Update type definitions for `graphql`, `node` and `jest`.

* dev: Update `graphql` to latest version, v0.13.2.

* 0.0.10

* Add defaultMaxAge option

This is an easy way to quickly say "I want everything in my schema to be cached
for 5 seconds". You can override it with specific maxAges on specific fields or
types.

An upcoming release of apollo-server-* will allow you to specify options to
cacheControl.

* Add CircleCI config

* Add partial CHANGELOG

* 0.1.0

* Honor overwrite default maxAge with maxAge=0 (Fixes #22) (#23)

* 0.1.1

* Allow default caching to apply to interfaces

* remove unused files

* update versions and use a-s style config

* run prettier

* fix tests and typing
2018-07-03 15:08:42 -07:00
Evans Hauser
8496387c78
Import apollo-tracing-js (#1292)
* Initial commit

* 0.0.3

* Replace endOffset with duration in resolver calls

* 0.0.4

* Fix duration

* 0.0.5

* Remove unnecessary schema level resolve function and return schema

* Update README

* 0.0.6

* Update README

* Update dependencies

* 0.0.7

* Update README

* set package.json to point to this repository (#3)

* Update dependencies

Fixes #4.

* 0.0.8

* Add asynciterable support to tsconfig.json

* Skip trace collection when context or context._traceCollector is undefined

Fixes #5.

* 0.0.9

* Rewrite to use graphql-extensions

* 0.0.10

* 0.0.11

* 0.1.0

* Update graphql-extensions dependency and downgrade TS target

* 0.1.1

* Update README

* Update README

* Increase version range for `graphql` peerDependency. (#7)

* 0.1.2

* Update dependencies

* 0.1.3

* [apollo-bot] Update the Issue/PR Templates with auto label (#9)

* Update `graphql` peer dependency range to allow 0.13.x.

* dev: Update TypeScript to latest version, v2.7.2.

* dev: Update jest & dependencies to latest versions.

* dev: Update type definitions for `graphql`, `node` and `jest`.

* Allow `undefined` to return from `format`. (#12)

* Allow `undefined` to return from `format`.

TypeScript 2.7 introduced new "Strict Class Instantiation" rules which,
as the name suggests, require properties which are intended to be set
(eventually, to a type) be set during construction.

Before this change, the `TracingExtension` class was deferred setting these
private properties (namely, `startWallTime`, `endWallTime`, `startHrTime`
and `duration`), but not during instantiation which required setting
marking them as optional and guarding their usage in other methods which
might use those (temporarily `undefined`, if even for a tick) properties.
For example, the expectation that `format` is _only_ called after
`requestDidStart` is not guaranteed with this configuration, even if it is
expected under normal operation.

Therefore, this change adds the additional guarding and updates the `format`
method to return `undefined` in the event that it doesn't have the appropriate
data.

* Update `graphql-extensions` dependency to `~0.0.9`.

Specifically, to take advantage of a type which landed in
`graphql-extensions@0.0.9` thanks to
https://github.com/apollographql/graphql-extensions/pull/10.

* 0.1.4

* Update for graphql-extensions@0.1.0 API (#13)

* Upgrade to TypeScript 2.8

* Add tslint and prettier

* Update for graphql-extensions@0.1.0 API

* 0.2.0-beta.0

* Make work with newest API usage

format() now gets called before the requestDidStart() EndHandler.

* 0.2.0-beta.1

* remove unused files from tracing package

* upgrade packages, fix compilation bugs, and add test
2018-07-03 13:53:25 -07:00