Commit graph

1069 commits

Author SHA1 Message Date
Ben Newman
543b9c8432
Require apollo-engine-reporting only if EngineReportingAgent used. (#2305)
When getEngineServiceId does not return a truthy value, we can save memory
and startup time by avoiding importing apollo-engine-reporting, which
(among its other dependencies) imports the protobuf.js implementation.
2019-02-12 11:21:07 -05:00
Ben Newman
96351a4db6 Remove unused lodash dependency. (#2303)
The only usage of lodash was removed by @martijnwalraven in commit
a09d514e59.
2019-02-12 17:44:22 +02:00
Jesse Rosenberger
a3222ece11
Publish
- apollo-cache-control@0.5.0
 - apollo-datasource-rest@0.3.0
 - apollo-datasource@0.3.0
 - apollo-engine-reporting@1.0.0
 - apollo-graphql@0.1.0
 - apollo-server-azure-functions@2.4.0
 - apollo-server-cache-memcached@0.3.0
 - apollo-server-cache-redis@0.3.0
 - apollo-server-caching@0.3.0
 - apollo-server-cloud-functions@2.4.0
 - apollo-server-cloudflare@2.4.0
 - apollo-server-core@2.4.0
 - apollo-server-express@2.4.0
 - apollo-server-hapi@2.4.0
 - apollo-server-integration-testsuite@2.4.0
 - apollo-server-koa@2.4.0
 - apollo-server-lambda@2.4.0
 - apollo-server-micro@2.4.0
 - apollo-server-plugin-base@0.3.0
 - apollo-server-testing@2.4.0
 - apollo-server@2.4.0
 - apollo-tracing@0.5.0
 - graphql-extensions@0.5.0
2019-02-07 14:08:23 +02:00
Jesse Rosenberger
f74610b290
Publish
- apollo-cache-control@0.5.0-alpha.3
 - apollo-datasource-rest@0.3.0-alpha.3
 - apollo-engine-reporting@1.0.0-alpha.3
 - apollo-graphql@0.0.1-alpha.1
 - apollo-server-azure-functions@2.4.0-alpha.4
 - apollo-server-cloud-functions@2.4.0-alpha.4
 - apollo-server-cloudflare@2.4.0-alpha.4
 - apollo-server-core@2.4.0-alpha.4
 - apollo-server-express@2.4.0-alpha.4
 - apollo-server-hapi@2.4.0-alpha.4
 - apollo-server-integration-testsuite@2.4.0-alpha.4
 - apollo-server-koa@2.4.0-alpha.4
 - apollo-server-lambda@2.4.0-alpha.4
 - apollo-server-micro@2.4.0-alpha.4
 - apollo-server-plugin-base@0.3.0-alpha.4
 - apollo-server-testing@2.4.0-alpha.4
 - apollo-server@2.4.0-alpha.4
 - apollo-tracing@0.5.0-alpha.3
 - graphql-extensions@0.5.0-alpha.4
2019-02-07 13:01:14 +02:00
Jesse Rosenberger
e971bdf8b4
TEMP: Revert "feat(Fastify) Apollo server Fastify integration #626 (#1971)"
This TEMPORARILY reverts commit 069110b353,
which was the result of the work done in #1971 by @rkorrelboom.

Unfortunately, we need to put this on ice while we wait for movement on a
package naming conflict.  The dialog surrounding this is under way, as
I've explained in the PR:

https://github.com/apollographql/apollo-server/pull/1971#issuecomment-456817749

I'm excited to re-land this in an upcoming version, but there's no reason to
block the 2.4.0 release for it right now.

I will open a new PR with the work from #1971 in due time.
2019-02-07 12:56:03 +02:00
Jesse Rosenberger
60b8bca6da
Merge branch 'master' into release-2.4.0 2019-02-07 12:40:37 +02:00
Jesse Rosenberger
5ee9845537
Compare Engine reporting's privateHeaders case-insensitively, as documented.
The documentation for `privateHeaders`[[0]] suggests that it is
case-insensitive.  While that statement is true, and the incoming header is
lower-cased before checking it against the `privateHeaders` configuration,
it assumed that the headers in the `privateHeaders` object were specified in
lower-case.

This changes the comparison to lower-case both sides prior to determining
equality.

[0]: https://github.com/apollographql/apollo-server/blob/abb8dc58/packages/apollo-engine-reporting/src/agent.ts#L67-L70

Fixes: https://github.com/apollographql/apollo-server/issues/2273
2019-02-06 12:50:10 +02:00
Jesse Rosenberger
3dfbfcc0d8
Use Array.isArray rather than typeof ... === 'object' to check Arrayness. 2019-02-06 12:24:01 +02:00
Jesse Rosenberger
5666235119
Merge branch 'master' into release-2.4.0 2019-02-06 12:06:02 +02:00
Jesse Rosenberger
f99ebd373b
Set apollo-datasource-rest version back to v0.2.2.
Lerna will take care of this on publishing.
2019-02-05 13:11:43 +02:00
Chris Airey
e8e49026dd Serialize arrays as JSON on fetch in RESTDataSource 2019-02-05 03:38:21 -05:00
Dennis Johnson
95949971d4 chore(deps): update dependency @types/koa-bodyparser to a valid 4.2.1… (#2217)
… version

This PR should hopefully correct some typing issues we are currently facing.

The problem:
- this package references v5.0.1 for @types/koa-bodyparser
- when we start our server that also uses koa-bodyparser for non-graphql routes, the type for koa.Request sets the "body" field to:

```
declare module "koa" {
    interface Request {
        body: {} | null | undefined;
        rawBody: {} | null | undefined;
    }
}
```

Which breaks our type defs for koa-bodyparser as we actually want "body" to be set to "any."

The v5.0.1 that was originally placed here is no longer "latest" and they have published a new v4 version that has the correct typing for koa-bodyparser (setting body to any). - https://www.npmjs.com/package/@types/koa-bodyparser

<!--
  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:

* [ ] 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
2019-02-04 18:10:07 +02:00
Jesse Rosenberger
d0998e7e28
Merge remote-tracking branch 'origin/master' into release-2.4.0 2019-02-04 17:22:15 +02:00
Jesse Rosenberger
59d5a5088a
Add apollo-graphql as a project reference to apollo-engine-reporting. 2019-02-01 20:40:28 +02:00
Jesse Rosenberger
b3758d8e47
Update apollo-engine-reporting's CHANGELOG.md for a major breaking change. 2019-02-01 20:40:27 +02:00
Jesse Rosenberger
9eca821345
Bump the major version of apollo-engine-reporting. 2019-02-01 20:40:27 +02:00
Jesse Rosenberger
21c274870f
Use lodash.sortby modularly, rather than all of lodash.
Currently, the only place that we use `lodash` in the entire `apollo-server`
repository is to utilize the `sortBy` function in this signature generation.

Looking at the bundle stats, it appears that lodash represents 7.1% of the
`apollo-server` package.  We're a server, so bundle size is generally less
of a concern, but it's still not to be ignored, particularly as we move into
worker environments.  More pressingly though, since this package will be
utilized by the `apollo` CLI, we'll be shaving precious download time off
the invocation of `npx apollo` if we can get this down.

By switching to the modular package (but still depending on `@types/lodash`
for _just_ the `ListIteratee` type — which we only need in development — we
should be able to trim 55.4kB minified (19.1kB minified+gzip'd) off the
`apollo-server` build.

cc @trevor-scheer @jbaxleyiii @martijnwalraven
2019-02-01 20:40:14 +02:00
Jesse Rosenberger
96de2d71d7
Move Engine signature AST traversals/transforms into ./transforms module.
These AST visitors and transformations are more generally usable for other
purposes rather than just the Apollo Engine signature reporting and would
seem to belong in a module of their own.
2019-02-01 20:40:11 +02:00
Jesse Rosenberger
e565226370
Move apollo-engine-reporting signature calculations to new apollo-graphql.
Many of these signature calculation functions are now utilized in tools or
helpers which are not directly related to `apollo-server` functionality,
including various aspects of the `apollo` CLI which live within
`apollo-tooling`.

Currently, because of `apollo`'s dependency on `apollo-engine-reporting` for
this signature, this requires bringing in the entire dependency tree which
`apollo-server-core` relies on since `apollo-engine-reporting` depends on
`apollo-server-core`.

By moving this into this new `apollo-graphql` utility library, we're able to
trim that rather hefty dependency tree and drastically reduce the download
for running, say, `npx apollo`.
2019-02-01 19:03:59 +02:00
Jesse Rosenberger
1a3ac9b4a0
Move Apollo Engine signatures into apollo-graphql. 2019-02-01 18:43:04 +02:00
Jesse Rosenberger
6092e99bf1
Publish
- apollo-graphql@0.0.1-alpha.0
2019-02-01 18:22:58 +02:00
Jesse Rosenberger
e55f231291
Setup the foundation for a new apollo-graphql utility library.
As of this commit, this package provides nothing!
2019-02-01 18:20:59 +02:00
Jesse Rosenberger
21c4c11a18
Merge remote-tracking branch 'public/master' into release-2.4.0 2019-02-01 14:00:59 +02:00
Jesse Rosenberger
8d9d7fea12
Publish
- apollo-engine-reporting@0.2.2
 - apollo-server-core@2.3.4
2019-01-31 19:03:17 +02:00
Trevor Scheer
b64895ddec
Add apollo-server-core to deps in apollo-engine-reporting (#2248)
* Add apollo-server-core to deps in apollo-engine-reporting

* Add reference to requestPipelineAPI
2019-01-31 08:59:36 -08:00
Jesse Rosenberger
03283f9ad3
Merge branch 'master' into release-2.4.0 2019-01-29 12:10:13 +02:00
Jesse Rosenberger
5939327edd
Publish
- apollo-server-azure-functions@2.3.3
 - apollo-server-cloud-functions@2.3.3
 - apollo-server-cloudflare@2.3.3
 - apollo-server-core@2.3.3
 - apollo-server-express@2.3.3
 - apollo-server-hapi@2.3.3
 - apollo-server-integration-testsuite@2.3.3
 - apollo-server-koa@2.3.3
 - apollo-server-lambda@2.3.3
 - apollo-server-micro@2.3.3
 - apollo-server-plugin-base@0.2.3
 - apollo-server-testing@2.3.3
 - apollo-server@2.3.3
 - graphql-extensions@0.4.3
2019-01-29 11:51:30 +02:00
Jesse Rosenberger
db39aa5604
Remove willStart from apollo-server, already called via …-express. (#2239)
* Remove `willStart` from `apollo-server`, already called via `...-express`.

When the request pipeline was initially introduced, the integrations
had yet to be updated to call the new life-cycle events.  Now, the
integrations have all caught up, but `apollo-server` is still calling
`willStart`, despite the fact that its dependency which provides the actual
server implementation — `apollo-server-express` – is _also_ calling it,
resulting in double invocation of this event.

I suspect some follow-up work should guard against this possibility, but for
now this should remove the duplication.

* Update CHANGELOG.md for #2239.

Ref: https://github.com/apollographql/apollo-server/pull/2239
2019-01-29 11:39:08 +02:00
Kurt Mackey
cd674aae72 More strict check for node version for graphql-upload (#2235)
Stop traversing the `graphql-upload` module tree in all non-Node.js environments, to support subset-V8 runtimes like Fly.io.
2019-01-29 11:36:40 +02:00
renovate[bot]
82674bf129
chore(deps): update dependency koa to v2.7.0 (#2233) 2019-01-28 11:09:34 +00:00
Jesse Rosenberger
d48d0972c5
Publish
- apollo-cache-control@0.4.1
 - apollo-datasource-rest@0.2.2
 - apollo-datasource@0.2.2
 - apollo-engine-reporting@0.2.1
 - apollo-server-azure-functions@2.3.2
 - apollo-server-cache-memcached@0.2.2
 - apollo-server-cache-redis@0.2.2
 - apollo-server-caching@0.2.2
 - apollo-server-cloud-functions@2.3.2
 - apollo-server-cloudflare@2.3.2
 - apollo-server-core@2.3.2
 - apollo-server-express@2.3.2
 - apollo-server-hapi@2.3.2
 - apollo-server-integration-testsuite@2.3.2
 - apollo-server-koa@2.3.2
 - apollo-server-lambda@2.3.2
 - apollo-server-micro@2.3.2
 - apollo-server-plugin-base@0.2.2
 - apollo-server-testing@2.3.2
 - apollo-server@2.3.2
 - apollo-tracing@0.4.1
 - graphql-extensions@0.4.2
2019-01-25 18:48:18 +02:00
Jesse Rosenberger
14c93a5ecf
Update apollo-cache-control's CHANGELOG.md in preparation for publishing. 2019-01-25 18:19:43 +02:00
David Glasser
821578775d apollo-cache-control: consider hintless root fields to be uncached (#2210)
This is consistent with the old engineproxy interpretation of cache hints. We
special-case scalar fields to inherit their parent field's hints for
simplicity (so you don't have to hint every scalar field in a hinted object),
but when the parent field is non-root that inherited hint gets defaultMaxAge
applied to it. When the parent field is the root, that inherited hint doesn't
get defaultMaxAge applied because we don't run willResolveField for the root
query.

Includes a CHANGELOG update for #2197.
2019-01-25 18:06:25 +02:00
Jesse Rosenberger
18d9041db7
Don't write to persisted query cache until execution will begin. (#2227)
Since we already write to the persisted query cache asynchronously (and
intentionally do not await the Promise) this won't have any affect on the
current behavior of when the persisted query cache is written to in the
event of an executable request, but if an operation comes in and doesn't
parse or validate, we'll avoid wasting cache space on an operation that will
never execute.

Additionally, in a similar light, if a plugin throws an error which stops
execution, we can avoid the side-effect of writing to the persisted query
cache.

In terms of the APQ behavior, while this could cause additional round-trips
for a client which repeatedly sends an invalid operation, that operation is
never going to successfully finish anyway.  While developer tooling will
help avoid this problem in the first place, this refusal to store an invalid
operation in the APQ cache could actually help diagnose a failure since the
full operation (rather than just the SHA256 of that document) will appear
in the browser's dev-tools on the retry.

If we're looking to spare parsing and validating documents which we know are
going to fail, I think that's going to be a better use of the (new)
`documentStore` cache (#2111), since its in-memory and can accommodate a
more complex data structure which includes the validation errors from the
previous attempt which will, of course, be the same when validating the same
operation against the same schema again.  As the PR that introduced that
feature shows, sparing those additional parses and validations (cached APQ
documents still needs to be parsed and validated, currently) will provide a
more successful performance win overall.

Ref: https://github.com/apollographql/apollo-server/pull/2111
2019-01-25 18:01:15 +02:00
renovate[bot]
117ea3042b chore(deps): update dependency prettier to v1.16.1 (#2203)
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| prettier | devDependencies | minor | `1.15.3` -> `1.16.1` | [homepage](https://prettier.io), [source](https://togithub.com/prettier/prettier) |

---

### Release Notes

<details>
<summary>prettier/prettier</summary>

### [`v1.16.1`](https://togithub.com/prettier/prettier/blob/master/CHANGELOG.md#&#8203;1161)

[Compare Source](https://togithub.com/prettier/prettier/compare/1.16.0...1.16.1)

[diff](https://togithub.com/prettier/prettier/compare/1.16.0...1.16.1)

-   JavaScript: Do not format functions with arguments as react hooks ([#&#8203;5778] by [@&#8203;SimenB])

    The formatting added in Prettier 1.16 would format any function receiving an
    arrow function and an array literal to match React Hook's documentation.
    Prettier will now format this the same as before that change if the arrow
    function receives any arguments.

    <!-- prettier-ignore -->

    ```js
    // Input
    ["red", "white", "blue", "black", "hotpink", "rebeccapurple"].reduce(
      (allColors, color) => {
        return allColors.concat(color);
      },
      []
    );

    // Output (Prettier 1.16.0)
    ["red", "white", "blue", "black", "hotpink", "rebeccapurple"].reduce((
      allColors,
      color
    ) => {
      return allColors.concat(color);
    }, []);

    // Output (Prettier 1.16.1)
    ["red", "white", "blue", "black", "hotpink", "rebeccapurple"].reduce(
      (allColors, color) => {
        return allColors.concat(color);
      },
      []
    );
    ```

-   JavaScript: Add necessary parentheses for decorators ([#&#8203;5785] by [@&#8203;ikatyang])

    Parentheses for decorators with nested call expressions are optional for legacy decorators
    but they're required for decorators in the current [proposal](https://tc39.github.io/proposal-decorators/#sec-syntax).

    <!-- prettier-ignore -->

    ```js
    // Input
    class X {
      @&#8203;(computed().volatile())
      prop
    }

    // Output (Prettier 1.16.0)
    class X {
      @&#8203;computed().volatile()
      prop
    }

    // Output (Prettier 1.16.1)
    class X {
      @&#8203;(computed().volatile())
      prop
    }
    ```

-   TypeScript: Stable parentheses for function type in the return type of arrow function ([#&#8203;5790] by [@&#8203;ikatyang])

    There's a regression introduced in 1.16 that
    parentheses for function type in the return type of arrow function were kept adding/removing.
    Their parentheses are always printed now.

    <!-- prettier-ignore -->

    ```ts
    // Input
    const foo = (): (() => void) => (): void => null;
    const bar = (): () => void => (): void => null;

    // First Output (Prettier 1.16.0)
    const foo = (): () => void => (): void => null;
    const bar = (): (() => void) => (): void => null;

    // Second Output (Prettier 1.16.0)
    const foo = (): (() => void) => (): void => null;
    const bar = (): () => void => (): void => null;

    // Output (Prettier 1.16.1)
    const foo = (): (() => void) => (): void => null;
    const bar = (): (() => void) => (): void => null;
    ```

-   MDX: Correctly recognize inline JSX ([#&#8203;5783] by [@&#8203;ikatyang])

    Previously, some inline JSXs are wrongly recognized as block HTML/JSX,
    which causes unexpected behaviors. This issue is now fixed.

    <!-- prettier-ignore -->

    ```md
    <!-- Input -->
    _foo <InlineJSX /> bar_

    <!-- Output (Prettier 1.16.0) -->
    _foo

    <InlineJSX /> bar_

    <!-- Output (Prettier 1.16.1) -->
    _foo <InlineJSX /> bar_
    ```

[@&#8203;ikatyang]: https://togithub.com/ikatyang

[@&#8203;simenb]: https://togithub.com/SimenB

[#&#8203;5778]: https://togithub.com/prettier/prettier/pull/5778

[#&#8203;5783]: https://togithub.com/prettier/prettier/pull/5783

[#&#8203;5785]: https://togithub.com/prettier/prettier/pull/5785

[#&#8203;5790]: https://togithub.com/prettier/prettier/pull/5790

### [`v1.16.0`](https://togithub.com/prettier/prettier/blob/master/CHANGELOG.md#&#8203;1160)

[Compare Source](https://togithub.com/prettier/prettier/compare/1.15.3...1.16.0)

[diff](https://togithub.com/prettier/prettier/compare/1.15.3...1.16.0)

🔗 [Release Notes](https://prettier.io/blog/2019/01/20/1.16.0.html)

</details>

---

### Renovate configuration

📅 **Schedule**: "after 6pm every weekday,before 5am 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.

---

 - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#apollographql/apollo-server).
2019-01-23 17:46:53 +02:00
Jesse Rosenberger
f045a4d0c9
Publish
- apollo-cache-control@0.5.0-alpha.2
 - apollo-datasource-rest@0.3.0-alpha.2
 - apollo-datasource@0.3.0-alpha.2
 - apollo-engine-reporting@0.3.0-alpha.2
 - apollo-server-azure-functions@2.4.0-alpha.3
 - apollo-server-cache-memcached@0.3.0-alpha.2
 - apollo-server-cache-redis@0.3.0-alpha.2
 - apollo-server-caching@0.3.0-alpha.2
 - apollo-server-cloud-functions@2.4.0-alpha.3
 - apollo-server-cloudflare@2.4.0-alpha.3
 - apollo-server-core@2.4.0-alpha.3
 - apollo-server-express@2.4.0-alpha.3
 - apollo-server-fastify@2.4.0-alpha.3
 - apollo-server-hapi@2.4.0-alpha.3
 - apollo-server-integration-testsuite@2.4.0-alpha.3
 - apollo-server-koa@2.4.0-alpha.3
 - apollo-server-lambda@2.4.0-alpha.3
 - apollo-server-micro@2.4.0-alpha.3
 - apollo-server-plugin-base@0.3.0-alpha.3
 - apollo-server-testing@2.4.0-alpha.3
 - apollo-server@2.4.0-alpha.3
 - apollo-tracing@0.5.0-alpha.2
 - graphql-extensions@0.5.0-alpha.3
2019-01-23 15:58:50 +02:00
Jesse Rosenberger
a550dfc549
Bump apollo-server-fastify to match last 2.4.0-alpha.x release.
This will cause the first release of `apollo-server-fastify` to land at
`2.4.0-alpha.3`.  (Hopefully.)
2019-01-23 15:53:59 +02:00
Remy
069110b353 feat(Fastify) Apollo server Fastify integration #626 (#1971)
* feat(fastify) Apollo Fastify server integration resolve #626

* feat(fastify) Use createHandler instead of applyMiddleware #626

* feat(fastify) Fix integration test for node 10 #626

* feat(fastify) Update README's with fastify createHandler interface #626

* feat(fastify) Implement the fastify createHandler as a synchronous method #626

* (fastify) Tweaks to re-align with the parallel work in #2054.

* (fastify): Use port 9999 rather than 8888 for tests.  Because Gatsby.

This specific port per integration is pretty brittle to begin with, but it
does work.  Currently, the fact that it works is facilitated by the fact
that most people don't use 5555 (Hapi) and 6666 (Express) for anything.

That said, the ever-popular Gatsby uses 8888 by default, so let's use 9999!

* (fastify) Remove duplicative assertion in upload initialization.

* (fastify) Implement fastify upload middleware

* (fastify) Fix linting issues

* (fastify) Update package-lock
2019-01-23 15:43:47 +02:00
Jesse Rosenberger
7d5468800f
Merge pull request #2111 from apollographql/abernix/cache-parsed-validated
Cache successfully parsed and validated documents for future requests.
2019-01-23 15:09:56 +02:00
Jesse Rosenberger
1d0021933e
Publish
- apollo-server-azure-functions@2.4.0-alpha.2
 - apollo-server-cloud-functions@2.4.0-alpha.2
 - apollo-server-cloudflare@2.4.0-alpha.2
 - apollo-server-core@2.4.0-alpha.2
 - apollo-server-express@2.4.0-alpha.2
 - apollo-server-hapi@2.4.0-alpha.2
 - apollo-server-integration-testsuite@2.4.0-alpha.2
 - apollo-server-koa@2.4.0-alpha.2
 - apollo-server-lambda@2.4.0-alpha.2
 - apollo-server-micro@2.4.0-alpha.2
 - apollo-server-plugin-base@0.3.0-alpha.2
 - apollo-server-testing@2.4.0-alpha.2
 - apollo-server@2.4.0-alpha.2
 - graphql-extensions@0.5.0-alpha.2
2019-01-23 15:04:23 +02:00
Jesse Rosenberger
2ed1c0e074
Revert (as intended!) "[debug] Print out documentStore stats every 60 seconds."
This reverts commit 7a0d0e6e96, as I intended
when I originally introduced it.

Ref: https://github.com/apollographql/apollo-server/pull/2111#issuecomment-454779949
2019-01-23 14:56:50 +02:00
renovate[bot]
e2bfc62275
chore(deps): update dependency @types/express to v4.16.1 (#2211) 2019-01-23 09:26:52 +00:00
Fabian Schneider
06e49077d8 Fix cache policy calculation when a hint has maxAge 0 (#2197)
Fixes apollographql/apollo-cache-control#11.
2019-01-22 16:53:10 -05:00
renovate[bot]
6e2cc5a8c5
chore(deps): update dependency @apollographql/apollo-tools to ^0.3.0 (#2190) 2019-01-17 04:22:44 +00:00
Jesse Rosenberger
33d1f82814
Publish
- apollo-cache-control@0.5.0-alpha.1
 - apollo-datasource-rest@0.3.0-alpha.1
 - apollo-datasource@0.3.0-alpha.1
 - apollo-engine-reporting@0.3.0-alpha.1
 - apollo-server-azure-functions@2.4.0-alpha.1
 - apollo-server-cache-memcached@0.3.0-alpha.1
 - apollo-server-cache-redis@0.3.0-alpha.1
 - apollo-server-caching@0.3.0-alpha.1
 - apollo-server-cloud-functions@2.4.0-alpha.1
 - apollo-server-cloudflare@2.4.0-alpha.1
 - apollo-server-core@2.4.0-alpha.1
 - apollo-server-express@2.4.0-alpha.1
 - apollo-server-hapi@2.4.0-alpha.1
 - apollo-server-integration-testsuite@2.4.0-alpha.1
 - apollo-server-koa@2.4.0-alpha.1
 - apollo-server-lambda@2.4.0-alpha.1
 - apollo-server-micro@2.4.0-alpha.1
 - apollo-server-plugin-base@0.3.0-alpha.1
 - apollo-server-testing@2.4.0-alpha.1
 - apollo-server@2.4.0-alpha.1
 - apollo-tracing@0.5.0-alpha.1
 - graphql-extensions@0.5.0-alpha.1
2019-01-16 13:11:21 +02:00
Jesse Rosenberger
7a0d0e6e96
[debug] Print out documentStore stats every 60 seconds.
In an effort to see how effective this cache is in production during this
alpha phase, we'll print out the stats on the document store every 60
seconds.
2019-01-16 13:07:17 +02:00
Jesse Rosenberger
be7162094c
Shift the burden of object approximation into the ApolloServerBase class.
The implementation of object-size approximation which is used for cache
eviction purposes in the `InMemoryLRUCache` implementation (via `lru-cache`)
was a short-term location for extensible logic which is better located
within `ApolloServerBase`.

This is particularly important since future logic may necessitate knowing or
understanding the current size (roughly, memory usage) of the in-memory
storage.  Effective immediately, this adds support for providing a `dispose`
function which is called when an object is purged from the cache to make
room for another.
2019-01-16 12:46:48 +02:00
renovate[bot]
9d047ebb36
chore(deps): update dependency @types/graphql (#2187) 2019-01-16 04:30:31 +00:00
Jesse Rosenberger
0879a1267e
Be considerate of variable length utf-8 encodings in InMemoryLRUCache.
Previously, this used the `JSON.stringify` length, but this is slightly more
aware.
2019-01-15 17:45:20 +02:00
Jesse Rosenberger
1a9d65dd81
Guard against (currently impossible) failure to read from documentStore.
While the implementation of the `documentStore` is currently simple enough
to never throw (it is in-memory), it makes some sense to guard against future
extended functionality where an exception might be raised.

Since storing this object in a distributed memory store isn't currently
feasible, I'm not sure what such an exception would be right now, but I
don't mind being proactive!

Ref: https://github.com/apollographql/apollo-server/pull/2111/files#r247618501
2019-01-15 17:03:00 +02:00