You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
experimental: Allow query plan & parsed/validated document cach… (#3755)
* experimental: Allow adjusting of query plan & parsed/validated document cache.
This introduces two experimental configuration options for existing internal
cache stores:
- `experimental_approximateDocumentStoreSizeMiB` is added to the `ApolloServer`
constructor options and controls the _approximate_[1] size, in MiB, of the
request pipeline document store, which is used to avoid repeated parsing and
validation passes on queries which equate to the same `queryHash`[2].
- `experimental_approximateQueryPlanStoreMiB` is added to the `ApolloGateway`
constructor options and controls the _approximate_[1] size of the query plan
cache, which is used to avoid recalculation on repeated queries which equate
to the same `queryHash`[2].
These are currently experimental because a more complete solution might
more dynamically account for memory of various internal caches and vary
their sizes based based on available memory and the overall server
performance, rather than needing hard-coded values which are less than
precise.
[1]: "Approximate", because it's based on the `JSON.stringify`'d byte-length
of the value being cached.
[2]: The `queryHash` is a SHA-256 value of the incoming operation.
* Add CHANGELOG.md for #3755.
* docs: Add documentation for #3755.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ The version headers in this history reflect the versions of Apollo Server itself
9
9
- Move TContext generic from requestDidStart method to ApolloServerPlugin Interface [#3525](https://github.com/apollographql/apollo-server/pull/3525)
10
10
-`apollo-server-express`: Support `CorsOptionsDelegate` type on `cors` parameter to `applyMiddleware`, to align with the supported type of the underlying [`cors`](https://npm.im/cors) middleware [itself](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/31483b781ac30f98bdf4d40a517e921f2fc2ce37/types/cors/index.d.ts#L32). [PR #3613](https://github.com/apollographql/apollo-server/pull/3613)
11
11
-`apollo-server-core`: Allow asynchronous initialization of datasources: the `initialize` method on datasources may now return a Promise, which will be settled before any resolvers are called. [#3639](https://github.com/apollographql/apollo-server/pull/3639)
12
+
-`apollo-server-core`: experimental: Allow configuration of the parsed/validated document store by introducing an `experimental_approximateDocumentStoreMiB` property to the `ApolloServer` constructor options which overrides the default cache size of 30MiB. [#3755](https://github.com/apollographql/apollo-server/pull/3755)
Copy file name to clipboardExpand all lines: docs/source/api/apollo-server.md
+13
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,19 @@ new ApolloServer({
144
144
145
145
Pass the integration-specific CORS options. `false` removes the CORS middleware and `true` uses the defaults. This option is only available to `apollo-server`. For other server integrations, place `cors` inside of `applyMiddleware`.
Copy file name to clipboardExpand all lines: packages/apollo-gateway/CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
* Reduce interface expansion for types contained to a single service [#3582](https://github.com/apollographql/apollo-server/pull/3582)
8
8
* Instantiate one `CachedFetcher` per gateway instance. This resolves a condition where multiple federated gateways would utilize the same cache store could result in an `Expected undefined to be a GraphQLSchema` error. [#3704](https://github.com/apollographql/apollo-server/pull/3704)
* experimental: Allow configuration of the query plan store by introducing an `experimental_approximateQueryPlanStoreMiB` property to the `ApolloGateway` constructor options which overrides the default cache size of 30MiB. [#3755](https://github.com/apollographql/apollo-server/pull/3755)
0 commit comments