Commit graph

2276 commits

Author SHA1 Message Date
Martijn Walraven
3cf067349b Fix some dependencies in tsconfig.test.json files 2018-10-11 23:10:45 +02:00
Martijn Walraven
2100639121 Enable forceConsistentCasingInFileNames in tsconfig.base.json 2018-10-11 23:10:44 +02:00
Martijn Walraven
6906cde5bf Add test:clean run command to clean Jest cache 2018-10-11 23:10:44 +02:00
Martijn Walraven
0491af858d Avoid use of object spread in Jest config files to support Node 6 2018-10-11 23:10:09 +02:00
Martijn Walraven
6c2f8d7583 Configure Jest to import local modules from src instead of dist
The Jest `moduleNameMapper` option allows us to match module names and transform the path that will be used to import them. If the resulting module is written in TypeScript, it will then be compiled by `ts-jest`, similar to relative imports within the package under test.
2018-10-11 20:23:16 +02:00
Martijn Walraven
68f4e83fb2 Fix import in apollo-cache-control 2018-10-11 20:17:37 +02:00
Nicolas Marien
94fc935d3c "Fix incorrect documentation for enum value" (#1802) 2018-10-11 16:36:31 +03:00
Martijn Walraven
9e843dbf4b Fix apollo-cache-control tests by augmenting schemas with cache control support 2018-10-11 15:05:06 +02:00
Martijn Walraven
787846c64b Fix apollo-server-env mock 2018-10-11 14:43:29 +02:00
Martijn Walraven
cef701e6c1 Remove test dependencies from non-test tsconfig.json files 2018-10-11 12:58:03 +02:00
Jesse Rosenberger
7966db5d3d
Add a Codecov configuration file to adjust the defaults.
In particular, we're not 100% sold on the Codecov charts - which add some
noise, but seem like they could be helpful at higher coverage percentages.

Also, for the time-being, we'll lower the target for `patch`s (i.e. PRs) to
zero, just to see how the values get reported in the CI checks.

Ref: https://docs.codecov.io/docs/commit-status
2018-10-11 13:04:22 +03:00
Martijn Walraven
16400909b6 Specify empty include in umbrella tsconfig files 2018-10-11 11:15:36 +02:00
renovate[bot]
73cbd03be0 chore(deps): update dependency @types/ws to v6 (#1609) 2018-10-11 12:05:19 +03:00
renovate[bot]
11979a0740 chore(deps): update dependency husky to v1.1.2 (#1801) 2018-10-11 12:05:06 +03:00
renovate[bot]
bc9492eb5b chore(deps): pin dependencies to 1.6.2 (#1797) 2018-10-11 12:04:52 +03:00
Renovate Bot
48bfc82f13 chore(deps): update dependency @types/node to v10.11.7 2018-10-11 06:25:04 +00:00
Martijn Walraven
6796ff310b Add paths config for shared __mocks__ to avoid relative imports 2018-10-11 08:20:49 +02:00
Martijn Walraven
f5d5981ffc Add TypeScript and Jest projects for tests in individual packages 2018-10-11 04:33:23 +02:00
Martijn Walraven
1ccef23906 Remove some empty tests 2018-10-11 04:11:49 +02:00
Martijn Walraven
ad758567b1 Rename apollo-cache-control tests so they will be picked up
It turns out we weren't running these tests before because they didn't end in `.test.ts`.
2018-10-11 04:10:51 +02:00
Jesse Rosenberger
dec2b94a0e
Publish
- apollo-cache-control@0.3.0-alpha.0
 - apollo-datasource-rest@0.2.0-alpha.0
 - apollo-datasource@0.2.0-alpha.0
 - apollo-engine-reporting-protobuf@0.1.0-alpha.0
 - apollo-engine-reporting@0.1.0-alpha.0
 - apollo-server-cache-memcached@0.2.0-alpha.0
 - apollo-server-cache-redis@0.2.0-alpha.0
 - apollo-server-caching@0.2.0-alpha.0
 - apollo-server-cloud-functions@2.2.0-alpha.0
 - apollo-server-cloudflare@2.2.0-alpha.0
 - apollo-server-core@2.2.0-alpha.0
 - apollo-server-env@2.1.0-alpha.0
 - apollo-server-errors@2.1.0-alpha.0
 - apollo-server-express@2.2.0-alpha.0
 - apollo-server-hapi@2.2.0-alpha.0
 - apollo-server-integration-testsuite@2.2.0-alpha.0
 - apollo-server-koa@2.2.0-alpha.0
 - apollo-server-lambda@2.2.0-alpha.0
 - apollo-server-micro@2.2.0-alpha.0
 - apollo-server-plugin-base@0.1.0-alpha.0
 - apollo-server@2.2.0-alpha.0
 - apollo-tracing@0.3.0-alpha.0
 - graphql-extensions@0.3.0-alpha.0
2018-10-10 22:30:54 +03:00
Jesse Rosenberger
db8fdc8d9d
Merge pull request #1795 from apollographql/abernix/re-new-request-pipeline
New Request Pipeline
2018-10-10 21:47:34 +03:00
Jesse Rosenberger
9089cc5c94
Follow-up un-reverted work to maintain support in the new request pipeline.
Prior to embarking on the request pipeline work, and to facilitate
development on the new request pipeline, @martijnwalraven and myself
intentionally reverted some commits that had been recently introduced but
conflicted with the request pipeline branch that was already in-flight.

Rather than dealing with an incredibly difficult merge conflict, it was
easier to revert them an re-apply them later.

Original commits, reversions, and reintroductions:

* 6d6c9ff, 03a894d, b90ccc2
* 96af44e, 68c82e6, 81c4642
* 408198e, 2b470e1, 84bc834
* 4175f1b, 38e7b6a, 261994c

As is demonstrated by this short follow-up commit, this was all that was
necessary to make it work in the new model - once that model was finished.

While we're certain that the new request pipeline and its plugin model will
actually better support some of the behavior that required these initial
commits in the name of not introducing breaking changes, we feel it's
necessary to maintain their support.

I will point out, if you are at all affected by the above commits, we may
consider deprecating portions of those APIs in the not too distant future,
but we hope that the new model will help support those needs even better.
2018-10-10 20:20:27 +03:00
C.J. Winslow
84bc8346cc
Pass the context request and response extension methods (#1547)
* Pass the context along to all the extension methods

Addresses #1343

With this change you should now be able to implement an extension like so:

```javascript
class MyErrorTrackingExtension extends GraphQLExtension {
    willSendResponse(o) {
        const { context, graphqlResponse } = o

        context.trackErrors(graphqlResponse.errors)

        return o
    }
}
```

Edit by @evans :
fixes #1343
fixes #614 as the request object can be taken from context or from requestDidStart
fixes #631 ""

* Remove context from extra extension functions

The context shouldn't be necessary for format, parse, validation, and
execute. Format generally outputs the state of the extension. Parse and
validate don't depend on the context. Execution includes the context
argument as contextValue

* Move change entry under vNext
2018-10-10 19:25:37 +03:00
Jesse Rosenberger
e4d672c568
Merge branch 'master' into abernix/re-new-request-pipeline 2018-10-10 19:14:20 +03:00
Alexander CherryTea
0b05b5e92e Update data.md (#1794)
That example code crush with error `find is not defined`, because in imports forgot about lodash `find` and `filter`
2018-10-10 17:26:58 +03:00
Dan Dascalescu
23ed96a6db More nuanced handling of stack traces in errors (#1708) 2018-10-10 17:22:10 +03:00
Martijn Walraven
17ed84d720 Add queryHash to request context 2018-10-10 16:20:45 +02:00
renovate[bot]
1102887599 chore(deps): update dependency husky to v1 (#1728)
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| husky | devDependencies | major | `0.14.3` -> `1.1.1` | [source](https://renovatebot.com/gh/typicode/husky) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v1.1.1`](https://renovatebot.com/gh/typicode/husky/blob/master/CHANGELOG.md#&#8203;111)

[Compare Source](https://renovatebot.com/gh/typicode/husky/compare/v1.1.0...v1.1.1)

-   Check `HUSKY_SKIP_INSTALL` value first before checking if `.git` exists
-   Check Node version before running hooks

### [`v1.1.0`](https://renovatebot.com/gh/typicode/husky/blob/master/CHANGELOG.md#&#8203;110)

[Compare Source](https://renovatebot.com/gh/typicode/husky/compare/v1.0.1...v1.1.0)

-   Create `.git/hooks` if it doesn't exist

### [`v1.0.1`](https://renovatebot.com/gh/typicode/husky/blob/master/CHANGELOG.md#&#8203;101)

[Compare Source](https://renovatebot.com/gh/typicode/husky/compare/v1.0.0...v1.0.1)

-   Various `husky-upgrade` changes ([#&#8203;362](https://renovatebot.com/gh/typicode/husky/pull/362), [#&#8203;360](https://renovatebot.com/gh/typicode/husky/pull/360), [#&#8203;359](https://renovatebot.com/gh/typicode/husky/pull/359))

### [`v1.0.0`](https://renovatebot.com/gh/typicode/husky/blob/master/CHANGELOG.md#&#8203;100)

[Compare Source](https://renovatebot.com/gh/typicode/husky/compare/v0.14.3...v1.0.0)

After a year of pre-releases and a complete rewrite, this marks the first stable release of husky 🐶🎉.

##### Notable changes

Below you'll find consolidated changes since `0.14.3`. There's no change in code between `1.0.0-rc.15` and `1.0.0`.

-   Hooks

    -   Add `sendemail-validate` hook

-   Config

    -   Move hooks config from `scripts` field to `husky` field
    -   Prefer raw names for hooks (e.g. `pre-commit` rather than `precommit`)
    -   Support `.huskyrc` config

-   Package managers

    -   Support environments where [yarn](https://renovatebot.com/gh/yarnpkg/yarn/) is the only package manager installed
    -   Support [pnpm](https://renovatebot.com/gh/pnpm/pnpm) package manager

-   Environment variables

    -   Add `HUSKY_SKIP_INSTALL` environment variable for skipping git hooks installation
    -   Add `HUSKY_GIT_STDIN` environment variable for `pre-push`, `pre-receive`, `post-receive` and `post-rewrite` to access arguments passed by Git via stdin
    -   Rename `GIT_PARAMS` to `HUSKY_GIT_PARAMS`

-   Messages

    -   Add many more messages in case of errors
    -   Add [please-upgrade-node](https://renovatebot.com/gh/typicode/please-upgrade-node) message if using with unsupported Node version
    -   Make `--no-verify` message more accurate and only show it for hooks that can be skipped

-   Upgrade

    -   Add `husky-upgrade` command to automatically migrate hooks in `package.json`
    -   Add deprecation warning for hooks that are still defined in `scripts`

-   Other
    -   Drop `Node 4` support
    -   Drop integrated `nvm` support (see Node version management in docs)

##### Credits

Huge thanks to all the Contributors and [Patreon Supporters](https://thanks.typicode.com)! 🙏

</details>

---

### Renovate configuration

📅 **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!`".

🔕 **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-10 17:20:44 +03:00
Martijn Walraven
f4400ac8af Rename dispatcher methods to clarify they invoke hooks 2018-10-10 16:17:10 +02:00
KarinaDavtyan
17073ed00b docs: update apollo-cache-control link (#1762) 2018-10-10 17:10:58 +03:00
Martijn Walraven
b4863f65e9 Compute query hash for non-APQ queries to use as a cache key 2018-10-10 16:05:04 +02:00
Martin d'Allens
e7296b79aa Docs: fix the example for "Using an Existing Schema" (#1761)
* Fix the example for "Using an Existing Schema"

The file caused the following error:
```
const gql = String.raw;
      ^
SyntaxError: Identifier 'gql' has already been declared
```

* Update migration-two-dot.md

* Update migration-two-dot.md
2018-10-10 16:57:18 +03:00
renovate[bot]
c9121b1948 chore(deps): update dependency lerna to v3.4.3 (#1789) 2018-10-10 16:27:19 +03:00
renovate[bot]
ff3c23f20b chore(deps): update dependency typescript to v3.1.2 (#1790) 2018-10-10 16:26:57 +03:00
Jovi De Croock
5be51b5a72 docs: add koa example since it is in the github title (#1780)
* docs: add koa example since it is in the github title

* fix: correct mistake

* Revert "fix: correct mistake"

This reverts commit 1de53f7e2b36c9ac7364a7f291f79bef4f77d777.

* fix: correct mistake

* Update README.md examples.

Follows-up on #1780 by fixing mismatching `port`s in the Koa example and switching other examples to be more DRY with regards to the `port` values.
2018-10-10 16:26:23 +03:00
Martijn Walraven
3fab039c1c Add didResolveOperation hook to request pipeline API 2018-10-10 15:19:11 +02:00
Martijn Walraven
f942af77b2 Clean up APQ code a little bit 2018-10-10 14:13:52 +02:00
renovate[bot]
99f7f94608 chore(deps): update dependency @types/lodash to v4.14.117 (#1787) 2018-10-10 15:13:44 +03:00
renovate[bot]
cf4d1f23e9 chore(deps): update dependency @types/node to v10.11.6 (#1788)
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| @types/node | devDependencies | patch | `10.11.5` -> `10.11.6` | [source](https://renovatebot.com/gh/DefinitelyTyped/DefinitelyTyped) |

---

### 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-10 15:13:23 +03:00
Renovate Bot
619ddd6e00 chore(deps): update dependency @types/jest to v23.3.5 2018-10-10 11:54:15 +00:00
Martijn Walraven
cea6404e92 Improve type safety of request pipeline API 2018-10-10 08:20:27 +02:00
Martijn Walraven
0f6594ae8e Don't skip APQs if no query is passed in 2018-10-09 21:37:29 +02:00
Martijn Walraven
59bc1c9318 Fix some request pipeline types 2018-10-09 21:35:51 +02:00
Martijn Walraven
e40f4a2b9b Add additional lifecycle hooks and allow returning didEnd handlers 2018-10-09 17:29:21 +02:00
Martijn Walraven
5b1760d78a Update graphql-subscriptions dependency to 1.0.0 in all packages 2018-10-09 12:18:25 +02:00
Martijn Walraven
960810c3f2 Remove jest types from tsconfig.base and add it to test configs 2018-10-09 12:02:11 +02:00
Martijn Walraven
f4234ca9c8 Move Jest configuration from package.json to jest.config.js 2018-10-09 11:44:16 +02:00
Martijn Walraven
02b645b347 Update graphql-subscriptions dependency to 1.0.0 2018-10-09 11:42:00 +02:00
Martijn Walraven
b7c9a6d8fe Add @types/ws and update ws dependency 2018-10-09 11:38:46 +02:00