Commit graph

2398 commits

Author SHA1 Message Date
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
Renovate Bot
a477bf9cd4 chore(deps): update dependency @types/node to v10.12.1 2018-10-30 06:29:55 +00:00
renovate[bot]
bda1a75d80 chore(deps): update dependency redis-mock to v0.37.0 (#1895) 2018-10-29 13:44:08 +01:00
renovate[bot]
f65281417f chore(deps): update dependency @types/jest to v23.3.8 (#1894) 2018-10-29 13:43:20 +01:00
renovate[bot]
6211f8b2b1 chore(deps): pin dependency @types/json-stable-stringify to 1.0.32 (#1887) 2018-10-29 13:41:40 +01:00
Jesse Rosenberger
b3da8a4391
Update package-lock.json to use https://registry.npmjs.org URLs. 2018-10-29 11:30:24 +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
Renovate Bot
7ad765090f chore(deps): update dependency @types/request to v2.48.0 2018-10-27 03:31:01 +00: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
5e85f4646b
Update package-lock.json.
These all look fine too me, though I'm not sure why they were so far off.
2018-10-26 20:40:31 +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
seya
ee81add0ff centralized “Get Started” Image in the doc (#1883)
* centralized “Get Started” Image

* Fixed to centralize the text no matter which font is used
2018-10-26 20:15:13 +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]
ae44b0df17 chore(deps): update dependency @types/aws-lambda to v8.10.14 (#1877) 2018-10-25 13:38:05 +03:00
renovate[bot]
5d9163c412 chore(deps): update dependency @types/jest to v23.3.7 (#1872) 2018-10-25 13:37:51 +03:00
renovate[bot]
d35acecc38 chore(deps): update dependency koa to v2.6.1 (#1873) 2018-10-25 13:37:39 +03:00
renovate[bot]
0d6a2d880d chore(deps): update dependency redis-mock to v0.34.1 (#1874)
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| redis-mock | devDependencies | minor | `0.33.0` -> `0.34.1` | [source](https://renovatebot.com/gh/yeahoffline/redis-mock) |

---

### Release Notes

<details>
<summary>yeahoffline/redis-mock</summary>

### [`v0.34.1`](d6809e124e...3fa5e9bf7d)

[Compare Source](d6809e124e...3fa5e9bf7d)

</details>

---

### Renovate configuration

📅 **Schedule**: "after 6pm every weekday,before 8am every weekday" in timezone America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻️ **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`".

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

This PR has been generated by [Renovate Bot](https://renovatebot.com/gh/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#apollographql/apollo-server).
2018-10-25 13:37:27 +03:00
Philipp Munzert
6e3620de81 Fixed typo in code example (#1847) 2018-10-25 11:36:21 +03:00
Espen Hovlandsdal
b2f677fb6e Fix typo in metrics documentation (#1856) 2018-10-25 11:07:21 +03:00
Wade Deng
f2b345918a fix typo in README of Koa example (#1876)
* fix typo in README of Koa js example

* docs: update changelog pr link

* Update CHANGELOG.md
2018-10-25 11:06:55 +03:00
Renovate Bot
41f919ce94 chore(deps): update dependency @types/hapi to v17.6.2 2018-10-25 08:01:26 +00:00
Renovate Bot
a619a8cd28 chore(deps): update dependency hexo to v3.8.0 2018-10-19 09:46:12 +00:00
Renovate Bot
2abff3434d chore(deps): update dependency graphql-tools to v4.0.2 2018-10-18 11:01:06 +00:00
Renovate Bot
618df697fa chore(deps): update dependency @types/micro to v7.3.3 2018-10-18 08:05:28 +00:00
Renovate Bot
dc3aa9594f chore(deps): update dependency form-data to v2.3.3 2018-10-17 10:04:38 +00:00
Renovate Bot
93326d7e45 chore(deps): update dependency @types/node to v10.12.0 2018-10-16 18:02:49 +00:00
Martijn Walraven
e5b0b57ef0 Avoid ReferenceError when accessing app in browser-like environments
Fixes #1804.
2018-10-16 16:40:49 +02:00
Marcin Jekot
87335b5998 Suggestion: change wording
Fix grammar, and hopefully make the explanation a bit clearer.

It could also be said like this (for a smaller diff) ;-)

"By allowing the consumer of the API to see the full possibilities that an API can *deliver*, developers can"...
2018-10-16 14:01:43 +02:00
Martijn Walraven
6dd71d3824 Replace GraphQLRequestPipeline with function 2018-10-16 13:59:30 +02:00
Renovate Bot
311d4635b0 chore(deps): update dependency @types/graphql to v14.0.3 2018-10-16 10:56:17 +00:00
Martijn Walraven
71b1ae4242 Export GraphQL request and reponse types from apollo-server-plugin-base 2018-10-15 12:42:09 +02:00
0xflotus
536b204de1 fixed arbitrarily (#1816) 2018-10-15 10:09:49 +03:00
0xflotus
e773932545 fixed typos in docs (#1817)
* Update authentication.md

* Update schema-design.md

* Update schema-design.md

* Update heroku.md

* Update lambda.md

* Update server.md
2018-10-15 10:09:25 +03:00
Victor Hugo Miranda Pinto
b0579982d0 Add Koa to the list of Apollo Server integrations (#1810) 2018-10-15 10:07:31 +03:00