Commit graph

2155 commits

Author SHA1 Message Date
Martijn Walraven
282ea7e022 Merge remote-tracking branch 'origin/typescript-project-references' into abernix/re-new-request-pipeline 2018-10-06 03:49:36 +02:00
Martijn Walraven
6654c0d1b7 Remove unused configuration options from tsconfig.test.json 2018-10-06 00:04:03 +02:00
Martijn Walraven
669b35c328 Upgrade ts-jest and fix config 2018-10-05 23:43:46 +02:00
Martijn Walraven
11a13cd3dd Remove apollo-server-env as a project reference
We can't use `apollo-server-env` as a project reference because that requires `composite: true`, and that implies `declaration: true`, which doesn't work for `apollo-server-env` because we need to write our own declaration files for re-exported imports.

This commit also removes `apollo-engine-reporting-protobuf` as a reference, which errored out because it doesn't actually contain any TypeScript code.
2018-10-05 23:05:49 +02:00
Martijn Walraven
8932091e67 Add root level tsconfig.json as entry point 2018-10-05 21:48:49 +02:00
Martijn Walraven
1aee215e68 Switch to tsc --build and remove run scripts from packages 2018-10-05 17:48:34 +02:00
Martijn Walraven
fcaa6ad79d Enable TypeScript project references 2018-10-05 17:47:29 +02:00
Martijn Walraven
5d03ae1650 Update to TypeScript 3.1 2018-10-05 17:18:13 +02:00
Martijn Walraven
f051c7cb80 Add comment about cloning the context 2018-10-05 16:30:21 +02:00
Jesse Rosenberger
aeabb861c5
Merge remote-tracking branch 'public/master' into abernix/re-new-request-pipeline 2018-10-05 16:43:00 +03:00
Jesse Rosenberger
d7d7b0babd
Merge branch 'abernix/plugin-base' into abernix/re-new-request-pipeline 2018-10-05 16:27:34 +03:00
Jesse Rosenberger
0ebf8900a0
Have npm run clean also remove the root node_modules.
...Because clean is clean!
2018-10-05 16:23:27 +03:00
Jesse Rosenberger
6ea82405ad
Add apollo-server-plugin-base to the monorepo's root package{-lock}?.json. 2018-10-05 16:12:05 +03:00
Martijn Walraven
87463582ed Fix cacheControl property in Config and GraphQLServerOptions
While cacheControl can take a boolean when passing it in  to ApolloServer as part of a Config, these will be converted to default options before passing them on as options.
2018-10-05 14:33:32 +02:00
Jesse Rosenberger
68f50cd09c Import specifically createHash, rather than * as crypto from crypto.
This silences the deprecation messages which have been showing up in recent
local development on the new request pipeline work.  e.g.:

> ```
> [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated.
>   Use tls.createSecureContext instead.
> [DEP0011] DeprecationWarning:
>   crypto.Credentials is deprecated. Use tls.SecureContext instead.
> ```
2018-10-05 13:12:10 +02:00
Jesse Rosenberger
07a9493996
Merge remote-tracking branch 'origin/abernix/re-new-request-pipeline' into HEAD 2018-10-05 13:51:33 +03:00
Martijn Walraven
d80209e4aa Fix typing of context property in GraphQLServerOptions
The actual resolving of the context happens in ApolloServer#graphQLServerOptions, but errors thrown while doing that are currently converted to a throwing function.
2018-10-05 09:48:58 +02:00
Martijn Walraven
891d62983a Refactor runHttpQuery and extract cache policy computation into CacheControlExtension 2018-10-05 09:08:12 +02:00
Jesse Rosenberger
2479473664
Introduce basic plugin and limited API to apollo-server-core. 2018-10-04 23:25:42 +03:00
Jesse Rosenberger
1ec383db36
Introduce a method to simplify the Engine service identifier. 2018-10-04 23:25:42 +03:00
Jesse Rosenberger
94a146a07e
Introduce a apollo-server-plugin-base as a foundation for plugins. 2018-10-04 23:25:42 +03:00
Jesse Rosenberger
98d4fc3674
Don't ever allow requestOptions to be undefined. 2018-10-04 23:25:42 +03:00
Jesse Rosenberger
f1bc734377
Import specifically createHash, rather than * as crypto from crypto.
This silences the deprecation messages which have been showing up in recent
local development on the new request pipeline work.  e.g.:

> ```
> [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated.
>   Use tls.createSecureContext instead.
> [DEP0011] DeprecationWarning:
>   crypto.Credentials is deprecated. Use tls.SecureContext instead.
> ```
2018-10-04 23:25:07 +03:00
Renovate Bot
60f39eb713 chore(deps): update dependency lerna to v3.4.1 2018-10-04 19:51:26 +00:00
Renovate Bot
bb0537b360 chore(deps): update dependency @types/node to v10.11.4 2018-10-04 18:04:16 +00:00
Renovate Bot
097cae5bdc chore(deps): update dependency @types/jest to v23.3.3 2018-10-04 13:49:17 +00:00
Renovate Bot
00a829ebb6 chore(deps): update dependency @types/hapi to v17.6.1 2018-10-04 11:47:33 +00:00
Martijn Walraven
7493077f18 Fix context and rootValue types in GraphQLServerOptions
The ability to pass in functions or promises shouldn't affect the type variable.
2018-10-02 14:00:34 +02:00
Renovate Bot
d626a7f130 chore(deps): update dependency jest-junit to v5.2.0 2018-10-02 12:00:33 +00:00
Martijn Walraven
ba0066edf8 Extract processHTTPRequest from runHttpQuery 2018-10-02 13:59:33 +02:00
Renovate Bot
ade92038a8 chore(deps): update dependency graphql-tag to v2.10.0 2018-10-02 10:14:43 +00:00
renovate[bot]
6fae839afa chore(deps): pin dependencies (#1740)
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| codecov | devDependencies | pin | `^3.1.0` -> `3.1.0` | [source](https://renovatebot.com/gh/codecov/codecov-node) |
| jest-junit | devDependencies | pin | `^5.1.0` -> `5.1.0` | [source](https://renovatebot.com/gh/jest-community/jest-junit) |

📌 **Important**: Renovate will wait until you have merged this Pin PR before creating any *upgrade* PRs for the affected packages. Add the preset `:preserveSemverRanges` your config if you instead don't wish to pin dependencies.

---

### Renovate configuration

📅 **Schedule**: PR created on schedule "after 6pm every weekday,before 8am every weekday" in timezone America/Los_Angeles

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://renovatebot.com/gh/renovatebot/config-help/issues) if that's undesired.

---

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-02 12:28:05 +03:00
Jesse Rosenberger
7c2fa2d136
Remove posttest npm script from package.json to avoid linting on tests.
The linting will happen in CircleCI.  Additionally, we already have
post-commit hooks so doing linting on every test run seems to just be
generally slowing down development since any linting problems are
automatically fixed when I do a commit.
2018-10-02 12:24:33 +03:00
Miguel Dorta
a61413a190 Fix typo (#1745) 2018-10-02 09:29:17 +02:00
Loc Nguyen
32db56169c Use gql tag in typeDef examples that were missing it. Also fix a type in a require statement. (#1756) 2018-10-02 09:28:37 +02:00
Renovate Bot
d2b1e3f9f0 chore(deps): update dependency @types/node to v10.11.3 2018-09-29 06:21:44 +00:00
Martijn Walraven
e2a22b23b5 Remove leftover debug output 2018-09-28 15:45:22 +02:00
Renovate Bot
5f89702d9a chore(deps): update dependency @types/node to v10.11.2 2018-09-27 19:00:08 +00:00
Renovate Bot
577e620678 chore(deps): update dependency @types/hapi to v17.6.0 2018-09-27 17:42:06 +00:00
Jesse Rosenberger
b90ccc2e8b
Make it more clear that generateClientInfo is an experimental API.
The `generateClientInfo` API, used to set client identification attributes
within traces, is an experimental API and is subject to removal or change in
a future (major) Apollo Server release.

Ref: #1631
2018-09-27 18:40:05 +03:00
Evans Hauser
81c46421a9
Provide ability to specify client info in traces (#1631)
* Provide ability to specify client info in traces

Adds the createClientInfo to apollo-engine-reporting, which enables the
differentiation of clients based on the request, operation, and
variables. This could be extended to include the response. However for
the first release. It doesn't quite make sense.

* Use extensions and context in createClientInfo

* Remove support for clientAddress

The frontend will not support it in the near future

* create -> generate and make default generator

createClientInfo -> generateClientInfo

* Clarify default values
2018-09-27 17:26:12 +03:00
Tim Griesser
261994ca7c
Allow an optional function to resolve the rootValue (#1555)
* Allow an optional function to resolve the rootValue

Passes the parsed DocumentNode AST to determine the root value,
useful when providing a different rootValue for query vs mutation

* Add API docs for rootValue
2018-09-27 16:57:46 +03:00
Martijn Walraven
7fbf35cc1c
Remove hash.js dependency and re-enable noUnusedLocals 2018-09-27 16:46:45 +03:00
Martijn Walraven
49248329ca
Move persisted query processing to GraphQLRequestProcessor 2018-09-27 16:46:45 +03:00
Martijn Walraven
faf1494a7f
Remove runQuery.ts and fix tests to use GraphQLRequestProcessor 2018-09-27 16:46:45 +03:00
Martijn Walraven
358b348677
Fix full lifecycle test with Engine reporting 2018-09-27 16:46:45 +03:00
Martijn Walraven
a09d514e59
Refactor runQuery into GraphQLRequestProcessor 2018-09-27 16:46:45 +03:00
Jesse Rosenberger
38e7b6a5b6
Revert "Allow an optional function to resolve the rootValue (#1555)"
This reverts commit 4175f1b9cd.
2018-09-27 16:46:39 +03:00
Jesse Rosenberger
2b470e1c11
Revert "Pass the context request and response extension methods (#1547)"
This reverts commit 408198e5ac.
2018-09-27 16:36:28 +03:00
Jesse Rosenberger
68c82e63c6
Revert "Provide ability to specify client info in traces (#1631)"
This reverts commit 96af44e41a.
2018-09-27 16:35:00 +03:00