Commit graph

1105 commits

Author SHA1 Message Date
Martijn Walraven
40f3660e23 Fix relative import to use the proper apollo-tools package 2018-11-09 09:23:29 -08:00
Martijn Walraven
8c9666d4d7 Update apollo-tools dependency 2018-11-09 09:12:51 -08:00
Martijn Walraven
e4a55498f8 Collect fields and pass these to resolveObject() 2018-11-09 05:49:58 -08:00
Martijn Walraven
8f6481e60f Add modules option to ApolloServer 2018-11-09 05:07:08 -08:00
Martijn Walraven
bb67584a22 Add support for resolveObject to query execution 2018-11-09 05:07:07 -08:00
Peter
d81ae051e7 Update README.md with the latest package name (#1936) 2018-11-08 16:29:18 -08:00
Divyendu Singh
0d6b8f24e6 Update README.md (#1938) 2018-11-08 14:53:18 -08:00
Martijn Walraven
6bd73b175f Publish
- apollo-cache-control@0.3.0
 - apollo-datasource-rest@0.2.0
 - apollo-datasource@0.2.0
 - apollo-engine-reporting-protobuf@0.1.0
 - apollo-engine-reporting@0.1.0
 - apollo-server-azure-functions@2.2.0
 - apollo-server-cache-memcached@0.2.0
 - apollo-server-cache-redis@0.2.0
 - apollo-server-caching@0.2.0
 - apollo-server-cloud-functions@2.2.0
 - apollo-server-cloudflare@2.2.0
 - apollo-server-core@2.2.0
 - apollo-server-env@2.2.0
 - apollo-server-errors@2.2.0
 - apollo-server-express@2.2.0
 - apollo-server-hapi@2.2.0
 - apollo-server-integration-testsuite@2.2.0
 - apollo-server-koa@2.2.0
 - apollo-server-lambda@2.2.0
 - apollo-server-micro@2.2.0
 - apollo-server-plugin-base@0.1.0
 - apollo-server-testing@2.2.0
 - apollo-server@2.2.0
 - apollo-tracing@0.3.0
 - graphql-extensions@0.3.0
2018-11-07 08:17:21 -08:00
Jesse Rosenberger
3eada89827
Publish
- apollo-server-azure-functions@2.2.0-alpha.4
2018-11-06 16:38:19 -08:00
Jesse Rosenberger
e1e126fc76
For lerna. 2018-11-06 16:24:23 -08:00
Jesse Rosenberger
6346be3a6f
Publish
- apollo-server-azure-functions@2.2.0-alpha.4
2018-11-06 16:03:16 -08:00
Jesse Rosenberger
0b1f887db2
Lower version of apollo-server-azure-functions to publish correct version via lerna. 2018-11-06 16:02:39 -08:00
Michael Watson
6c87cbc291 Correct name of Azure implementation to match original name. (#1926) 2018-11-06 13:46:33 -08:00
Jesse Rosenberger
79fe6bf0bf
Publish
- apollo-server-azure-function@2.2.0-alpha.4
 - apollo-server-cloud-functions@2.2.0-alpha.4
 - apollo-server-cloudflare@2.2.0-alpha.4
 - apollo-server-core@2.2.0-alpha.4
 - apollo-server-express@2.2.0-alpha.4
 - apollo-server-hapi@2.2.0-alpha.4
 - apollo-server-integration-testsuite@2.2.0-alpha.4
 - apollo-server-koa@2.2.0-alpha.4
 - apollo-server-lambda@2.2.0-alpha.4
 - apollo-server-micro@2.2.0-alpha.4
 - apollo-server-plugin-base@0.1.0-alpha.4
 - apollo-server-testing@2.2.0-alpha.4
 - apollo-server@2.2.0-alpha.4
 - graphql-extensions@0.3.0-alpha.4
2018-11-06 11:33:35 -08:00
Jesse Rosenberger
52f210dcdd
Bump apollo-server-azure-functions to 2.2.0-alpha.3 to align versions. 2018-11-06 11:32:03 -08:00
Leonid Buneev
5b64cf9160 apollo-server-azure-function v2 implementation. (#1753)
Closes #1752.
2018-11-06 11:28:25 -08:00
Jesse Rosenberger
25cbd3ad61
Don't require a plugin to subclass ApolloServerPlugin.
To avoid problems frequently associated with subclassing, and the possible
versioning ergonomics of subclassing the wrong version, this changes the
plugin infrastructure to no longer require subclassing the abstract class.
2018-11-06 10:01:52 -08:00
Jesse Rosenberger
5ca4c07bd5
Publish
- apollo-cache-control@0.3.0-alpha.3
 - apollo-engine-reporting-protobuf@0.1.0-alpha.3
 - apollo-engine-reporting@0.1.0-alpha.3
 - apollo-server-cloud-functions@2.2.0-alpha.3
 - apollo-server-cloudflare@2.2.0-alpha.3
 - apollo-server-core@2.2.0-alpha.3
 - apollo-server-express@2.2.0-alpha.3
 - apollo-server-hapi@2.2.0-alpha.3
 - apollo-server-integration-testsuite@2.2.0-alpha.3
 - apollo-server-koa@2.2.0-alpha.3
 - apollo-server-lambda@2.2.0-alpha.3
 - apollo-server-micro@2.2.0-alpha.3
 - apollo-server-plugin-base@0.1.0-alpha.3
 - apollo-server-testing@2.2.0-alpha.3
 - apollo-server@2.2.0-alpha.3
 - apollo-tracing@0.3.0-alpha.3
 - graphql-extensions@0.3.0-alpha.3
2018-11-05 21:36:39 -08:00
Jesse Rosenberger
58711be91a
Bump apollo-engine-reporting-protobuf to align prerelease version suffix. 2018-11-05 21:22:20 -08:00
James Baxley
3d69124340 change clientId => clientReportingId and schemaBranch => schemaTag (#1921)
@abernix this should be a lot more clear 👍
2018-11-05 21:18:25 -08:00
Jesse Rosenberger
a6872c2f6c
Publish
- apollo-cache-control@0.3.0-alpha.2
 - apollo-datasource-rest@0.2.0-alpha.2
 - apollo-datasource@0.2.0-alpha.2
 - apollo-engine-reporting@0.1.0-alpha.2
 - apollo-server-cache-memcached@0.2.0-alpha.2
 - apollo-server-cache-redis@0.2.0-alpha.2
 - apollo-server-caching@0.2.0-alpha.2
 - apollo-server-cloud-functions@2.2.0-alpha.2
 - apollo-server-cloudflare@2.2.0-alpha.2
 - apollo-server-core@2.2.0-alpha.2
 - apollo-server-express@2.2.0-alpha.2
 - apollo-server-hapi@2.2.0-alpha.2
 - apollo-server-integration-testsuite@2.2.0-alpha.2
 - apollo-server-koa@2.2.0-alpha.2
 - apollo-server-lambda@2.2.0-alpha.2
 - apollo-server-micro@2.2.0-alpha.2
 - apollo-server-plugin-base@0.1.0-alpha.2
 - apollo-server-testing@2.2.0-alpha.2
 - apollo-server@2.2.0-alpha.2
 - apollo-tracing@0.3.0-alpha.2
 - graphql-extensions@0.3.0-alpha.2
2018-11-05 11:45:46 -08:00
Jesse Rosenberger
c5e1760894
Adjust apollo-server-testing to start at 2.2.0-alpha.2. 2018-11-05 11:43:15 -08:00
Jesse Rosenberger
d7d4495b7b
(perf) Stop adding the checkOperationPlugin on every request.
This was causing the `checkOperationPlugin` to be added to the list of
plugins to be executed, thus resulting in an additional plugin pass (of the
same plugin) for each request.

1st request = 1 plugin
2nd request = 2 of the same plugin
3rd request = 3 of the same plugin

Obviously, this was not intended.
2018-11-05 11:23:26 -08:00
Jake Dawkins
e3d5be954f Introduce apollo-server-testing package. (#1909) 2018-11-05 11:22:30 -08:00
Jesse Rosenberger
422609e621
Merge pull request #1900 from apollographql/abernix/preserve-typescript-2-compat
Preserve TypeScript 2 Backwards compatibility until Semver Major
2018-11-05 07:14:45 -08:00
Jesse Rosenberger
0dfa8ed39b
(compat) Avoid TypeScript 3.x features to maintain backwards compatibility.
This mostly reverts fd34771841 along with a
number of slight adjustments to avoid other typing luxuries which were
introduced with TypeScript 3.x.

While the generic `ServerOptionFunction` types and `HandlerArguments`
generic rest argument type were certainly welcome additions to the codebase,
they present a backwards compatibility problem for consumers of Apollo
Server who have not yet made the jump to TypeScript 3.x.

With any luck, when we bump the major version of Apollo Server to 3.x, and
in accordance with semantic versioning, we'll be in the position to
straight-up revert this commit.
2018-11-05 05:24:32 -08:00
Tomáš Szabo
abbe382785 Make mocking configuration less confusing. (#1835)
* Make mocking configuration less confusing.
Setting mocks to false will always disable mocking.

* Updated CHANGELOG
2018-10-30 09:14:12 -07:00
Jesse Rosenberger
64e9099f86
Export CloudFunctionGraphQLOptionsFunction type, like other integrations.
This wasn't currently being exported, but this in-between commit will make
sure that the commit which follows this can be reverted without
inadvertently dropping this export.
2018-10-30 12:50:18 +02:00
Jesse Rosenberger
b98191c431
Avoid Function.prototype.bind when invoking createGraphQLServerOptions.
By avoiding this pattern, we can maintain better typing for users of
TypeScript 2.8, which didn't maintain typings when passing through
`Function.prototype.bind` calls.

Also, personally, this just appears to be more readable.
2018-10-30 12:34:43 +02:00
Andre Eberhardt
52da28d6b1 Fix apollo-server-cache delete implementation for both redis and memcached (#1891) 2018-10-29 11:25:09 +02:00
Jesse Rosenberger
5b83883233
Publish
- apollo-cache-control@0.3.0-alpha.1
 - apollo-datasource-rest@0.2.0-alpha.1
 - apollo-datasource@0.2.0-alpha.1
 - apollo-engine-reporting-protobuf@0.1.0-alpha.1
 - apollo-engine-reporting@0.1.0-alpha.1
 - apollo-server-cache-memcached@0.2.0-alpha.1
 - apollo-server-cache-redis@0.2.0-alpha.1
 - apollo-server-caching@0.2.0-alpha.1
 - apollo-server-cloud-functions@2.2.0-alpha.1
 - apollo-server-cloudflare@2.2.0-alpha.1
 - apollo-server-core@2.2.0-alpha.1
 - apollo-server-env@2.1.0-alpha.1
 - apollo-server-express@2.2.0-alpha.1
 - apollo-server-hapi@2.2.0-alpha.1
 - apollo-server-integration-testsuite@2.2.0-alpha.1
 - apollo-server-koa@2.2.0-alpha.1
 - apollo-server-lambda@2.2.0-alpha.1
 - apollo-server-micro@2.2.0-alpha.1
 - apollo-server-plugin-base@0.1.0-alpha.1
 - apollo-server@2.2.0-alpha.1
 - apollo-tracing@0.3.0-alpha.1
 - graphql-extensions@0.3.0-alpha.1
2018-10-26 21:28:15 +03:00
Jesse Rosenberger
bcfd76ceed
Add missing dependency on graphql-playground-html to apollo-server-core. 2018-10-26 20:39:23 +03:00
James Baxley
8b918e5bb6 fix failing test for default branch name 2018-10-26 20:19:30 +03:00
James Baxley
3eb0c3e79a update protobuf and remove default branch 2018-10-26 20:19:30 +03:00
James Baxley
49052b81d9 move @types/json-stable-stringify up to root 2018-10-26 20:19:30 +03:00
James Baxley
a729831d03 Support new protobuf fields in reporting
This commit supports two new concepts for reporting:

1. Client identity
2. Schema awareness

Client identity allows the GraphQLRequestContext to be mapped into
`clientId`, `clientName`, and `clientVersion` which can be used to
filter and view requests and metrics by client information.

Schema awareness introduces schema branches which allow arbitrary
strings to generate new "branches" (or variants) of a schema.
2018-10-26 20:19:30 +03:00
James Baxley
2ece27d82e Pass requestContext to GraphQLExtension requestDidStart 2018-10-26 20:19:30 +03:00
James Baxley
d10f961646 Generate schemaHash from schema
This commit adds a new field to the GraphQLServiceContext which is
a hashed representation of the schema. This is useful as a key value
to represent the schema and is sent as part of reporting to engine
when enabled
2018-10-26 20:19:30 +03:00
James Baxley
40d21f7d6a update protobuf to support client identity and schema awareness 2018-10-26 20:19:30 +03:00
Andre Eberhardt
b640be4fe6 feature(apollo-engine-reporting): Add custom http agent support (#1879)
This PR fixes #1836.

This PR enables developers to inject the http agent to be used on the network requests to apollo engine endpoint.

<!--
  Thanks for filing a pull request on GraphQL Server!

  Please look at the following checklist to ensure that your PR
  can be accepted quickly:
-->

TODO:

* [x] Update CHANGELOG.md with your change (include reference to issue & this PR)
* [x] Make sure all of the significant new logic is covered by tests
* [x] Rebase your changes on master so that they can be merged easily
* [x] Make sure all tests and linter rules pass

<!--**Pull Request Labels**

While not necessary, you can help organize our pull requests by labeling this issue when you open it.  To add a label automatically, simply [x] mark the appropriate box below:

- [ ] feature
- [ ] blocking
- [ ] docs

To add a label not listed above, simply place `/label another-label-name` on a line by itself.
-->
2018-10-26 20:14:18 +03:00
Jesse Rosenberger
c229b93f59 Fix incorrect comment about which graphql-playground- version this is.
It's actually the version of `graphql-playground-react` which is getting
served by `graphql-playground-html`.
2018-10-26 20:02:04 +03:00
Jesse Rosenberger
517264d579 Update to GraphQL Playground 1.7.8.
In addition to updating the `@apollographql/graphql-playground-html` fork,
which is necessary to avoid bundling `graphql-config` which had been
problematic in serverless environments, this updates the version number
which is served from the CDN.

I've just published `@apollographql/graphql-playground-html@1.6.4`.

Ref: https://github.com/apollographql/apollo-server/issues/1746
Ref: https://github.com/apollographql/graphql-playground/pull/2
Ref: https://github.com/apollographql/graphql-playground/pull/1

Thanks for @javlund for kicking off some of this work!
2018-10-26 20:02:04 +03:00
Jesse Rosenberger
1f8570b21d (test) Ensures the willStart event is triggered before a request. 2018-10-26 15:07:13 +03:00
Jesse Rosenberger
7dd30a62ed Remove incorrect comment: The health path is not the same as Engine.
Engine uses `engine-health` and this uses `server-health`.  They are
different!
2018-10-26 15:07:13 +03:00
Jesse Rosenberger
aae212f869 Triggers for newly introduced serverWillStart lifecycle hooks.
This commit follows-up on #1795, which introduced the new request pipeline, and
implements the triggers for its new life-cycle hooks within the various
integration packages.  Previously, the only implementation was within the
`apollo-server` package and didn't get triggered for those invoking the
`applyMiddleware` method on integrations (e.g. `apollo-server-express`,
`...-hapi` and `...-koa`).

While in an ideal world, ALL existing `applyMiddleware` functions would be
marked as `async` functions and allow us to `await ApolloServer#willStart`,
in practice the only `applyMiddleware` which is currently `async` is the one
within the Hapi implementation.  Therefore, we'll instead kick off the
`willStart` lifecycle hook as soon as `applyMiddleware` is started, return
as quickly as we have before and then (essentially) yield the completion of
Apollo Server's `willStart` prior to serving the first request — thus
ensuring the completion of server-startup activities.

Similarly, we'll do the same for `createHandler` methods on integrations
which don't utilize Node.js server frameworks but don't have `async`
handlers (e.g. AWS, Lambda, etc.).
2018-10-26 15:07:13 +03:00
Jesse Rosenberger
50a76d1786 Change types of the Google Cloud Funcs handler to allow options-as-a-function.
In the same manner as AWS Lambda, this now utilizes the
`ServerOptionsFunction` type pattern.  Previously, this typing still appears
to be incorrect, but that incorrectness was being missed because the
sole invocation of this at the end of this integrations `createHandler`
method was utilizing `this.createGraphQLServerOptions.bind(this)`, whose
types were unable to be inferred.  (I'm making a slight assumption on this
last bit because this mis-typing only surfaced after I switched to a more
explicit notation, but I believe this to be true).
2018-10-26 15:07:13 +03:00
Jan Hartmann
458bc71ead Enables parsing of application/hal+json as JSON in RESTDataSource (#1853) 2018-10-26 05:14:00 +02:00
Martijn Walraven
c1b0af18be
Add delete method to mock cache in integration tests 2018-10-25 14:40:57 +03:00
Jesse Rosenberger
4bad240ae4
Add delete implementations to the various cache store implementations. (#1878)
Includes:

* InMemory
* Redis
* Memcached
2018-10-25 14:32:14 +03:00
renovate[bot]
d35acecc38 chore(deps): update dependency koa to v2.6.1 (#1873) 2018-10-25 13:37:39 +03:00