-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Apollo GraphQL packages #216
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fee1fb8
to
d5ab8be
Compare
74e3400
to
0b63fea
Compare
0b63fea
to
ea2edc9
Compare
ea2edc9
to
d56e841
Compare
d56e841
to
a3fa14b
Compare
694cf08
to
db6d62c
Compare
4156c57
to
47ef33d
Compare
50b0234
to
d70c72f
Compare
51b73f0
to
310e261
Compare
654869c
to
d35a4a0
Compare
d7da99d
to
8d775ca
Compare
8d775ca
to
7660dea
Compare
308da77
to
667960e
Compare
cdc4848
to
fb73927
Compare
fb73927
to
c4f50a8
Compare
c4f50a8
to
338afdf
Compare
9d01e8e
to
316f516
Compare
13f5efa
to
5bb8645
Compare
5bb8645
to
2c73e25
Compare
2c73e25
to
cf16f91
Compare
cf16f91
to
b5f7d68
Compare
12afa72
to
55cb7e9
Compare
55cb7e9
to
2a5cdf3
Compare
2a5cdf3
to
b81df94
Compare
b81df94
to
ebd35bd
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.4.2
->2.7.1
4.7.1
->4.10.1
2.4.2
->2.7.1
3.12.0
->3.13.0
Release Notes
apollographql/federation (@apollo/gateway)
v2.7.1
Compare Source
Patch Changes
493f5acd16ad92adf99c963659cd40dc5eac1219
]:v2.7.0
Compare Source
Minor Changes
Implement progressive
@override
functionality (#2911)The progressive
@override
feature brings a new argument to the@override
directive:label: String
. When a label is added to an@override
application, the override becomes conditional, depending on parameters provided to the query planner (a set of which labels should be overridden). Note that this feature will be supported in router for enterprise users only.Out-of-the-box, the router will support a percentage-based use case for progressive
@override
. For example:The above example will override the root
hello
field from the "original" subgraph 5% of the time.More complex use cases will be supported by the router via the use of coprocessors/rhai to resolve arbitrary labels to true/false values (i.e. via a feature flag service).
Patch Changes
6ae42942b13dccd246ccc994faa2cb36cd62cb3c
,66833fb8d04c9376f6ed476fed6b1ca237f477b7
,931f87c6766c7439936df706727cbdc0cd6bcfd8
]:v2.6.3
Compare Source
Patch Changes
038cf0dbbfb0e2978b69f0a14bfd2c38b0cd1326
,69495b4810f3268c45a31f9d12e4f9cde2c447b5
]:v2.6.2
Compare Source
Patch Changes
7b5b836d15247c997712a47847f603aa5887312e
,74ca7dd617927a20d79b824851f7651ef3c40a4e
,ffe67dfbdb77d15dde2ab6dee66dba05c7b5c037
]:v2.6.1
Compare Source
Patch Changes
0d5ab01a
]:v2.6.0
Compare Source
Minor Changes
Add more information to OpenTelemetry spans. (#2700)
Rename
operationName
tographql.operation.name
and add agraphql.operation.type
attribute, in conformance with the OpenTelemetrySemantic Conventions for GraphQL. The
operationName
attribute is nowdeprecated, but it is still emitted alongside
graphql.operation.name
.Add a
graphql.document
span attribute to thegateway.request
span,containing the entire GraphQL source sent in the request. This feature
is disable by default.
When one or more GraphQL or internal errors occur, report them in the
OpenTelemetry span in which they took place, as an exception event. This
feature is disabled by default.
To enable the
graphql.document
span attribute and the exception eventreporting, add the following entries to your
ApolloGateway
instanceconfiguration:
Update
license
field inpackage.json
to useElastic-2.0
SPDX identifier (#2741)Introduce the new
@policy
scope for composition (#2818)Users may now compose
@policy
applications from their subgraphs into a supergraph.The directive is defined as follows:
The
Policy
scalar is effectively aString
, similar to theFieldSet
type.In order to compose your
@policy
usages, you must update your subgraph's federation spec version to v2.6 and add the@policy
import to your existing imports like so:@​link(url: "https://specs.apollo.dev/federation/v2.6", import: [..., "@​policy"])
Add graphql.operation.name attribute on gateway.plan span (#2807)
Patch Changes
b18841be
,e325b499
]:v2.5.7
Compare Source
Patch Changes
a0bdd7cb
]:v2.5.6
Compare Source
Patch Changes
c719214a
]:v2.5.5
Compare Source
Patch Changes
Fix specific case for requesting __typename on interface entity type (#2775)
In certain cases, when resolving a __typename on an interface entity (due to it actual being requested in the operation), that fetch group could previously be trimmed / treated as useless. At a glance, it appears to be a redundant step, i.e.:
It's actually necessary to preserve this in the case that we're coming from an interface object to an (entity) interface so that we can resolve the concrete __typename correctly.
Don't preserve useless fetches which downgrade __typename from a concrete type back to its interface type. (#2778)
In certain cases, the query planner was preserving some fetches which were "useless" that would rewrite __typename from its already-resolved concrete type back to its interface type. This could result in (at least) requested fields being "filtered" from the final result due to the interface's __typename in the data where the concrete type's __typename was expected.
Specifically, the solution was compute the path between newly created groups and their parents when we know that it's trivial (
[]
). Further along in the planning process, this allows to actually remove the known-useless group.Propagate type information when renaming entity fields (#2776)
Aliased entity fields might have been incorrectly overwritten if multiple fields/aliases shared the same name. Query planner automatically renames conflicting fields to ensure we can always generate a valid GraphQL query. The underlying issue was that this key rewriting logic was assuming the same type of an object. In case of entity queries asking for those aliased fields, we ended up always attempting to apply field renaming logic regardless, whether or not a given entity was of the correct type. This fix ensures that the query planner logic correctly accounts for the object type when applying field renaming logic.
Updated dependencies [
66d7e4ce
,a37bbbf6
]:v2.5.4
Compare Source
Patch Changes
Adds header to change the format of exposed query plans, and allows formatting it as json. (#2724)
When the gateway is configured to allow it, adding the
Apollo-Query-Plan-Experimental
header to a request already allowed a "prettified" text version of the query plan used for the query is returned in the response extension. This changes adds support for a new (optional) accompanying header,Apollo-Query-Plan-Experimental-Format
, which can be set to the value "internal" to have the query plan returned as a json object (that correspond to the internal representation of that query plan) instead of the text version otherwise sent. Note that if that new header is not provided, then the query plan continues to be send in the previous prettified text version.Fix some potentially incorrect query plans with
@requires
when some dependencies are involved. (#2726)In some rare case of
@requires
, an over-eager optimisation was incorrectly considering thata dependency between 2 subgraph fetches was unnecessary, leading to doing 2 subgraphs queries
in parallel when those should be done sequentially (because the 2nd query rely on results
from the 1st one). This effectively resulted in the required fields not being provided (the
consequence of which depends a bit on the resolver detail, but if the resolver expected
the required fields to be populated (as they should), then this could typically result
in a message of the form
GraphQLError: Cannot read properties of null
).Updated dependencies [
203b0a44
]:v2.5.3
Compare Source
Patch Changes
Fix execution error in some cases where aliases are used and some values are
null
. (#2716)The error would manifest itself as an
INTERNAL_SERVER_ERROR
with a message of the formCannot read properties of null
.Updated dependencies [
4b9a512b
,c6e0e76d
,1add932c
,6f1fddb2
]:v2.5.2
Compare Source
Patch Changes
Remove extraneous call to
span.setStatus()
on a span which has already ended. (#2697)In cases where a subgraph responded with an error, we would sometimes try to set
the status of a span which had already ended. This resulted in a warning log to
the console (but no effect otherwise). This warning should no longer happen.
Fix
fallbackPollIntervalInMs
behavior. (#2709)The
fallbackPollIntervalInMs
serves 2 purposes:The second bullet is how the configuration option is documented, but not how it was previously implemented. This change corrects the behavior to respect this configuration if it's provided AND is longer than the Uplink interval.
Updated dependencies [
35179f08
]:v2.5.1
Compare Source
Patch Changes
Reapply #2639: (#2687)
Try reusing named fragments in subgraph fetches even if those fragment only apply partially to the subgraph. Before this change, only named fragments that were applying entirely to a subgraph were tried, leading to less reuse that expected. Concretely, this change can sometimes allow the generation of smaller subgraph fetches.
Additionally, resolve a bug which surfaced in the fragment optimization logic which could result in invalid/incorrect optimizations / fragment reuse.
Updated dependencies [
b9052fdd
]:v2.5.0
Compare Source
Minor Changes
Do not run the full suite of graphQL validations on supergraphs and their extracted subgraphs by default in production environment. (#2657)
Running those validations on every updates of the schema takes a non-negligible amount of time (especially on large
schema) and mainly only serves in catching bugs early in the supergraph handling code, and in some limited cases,
provide slightly better messages when a corrupted supergraph is received, neither of which is worth the cost in
production environment.
A new
validateSupergraph
option is also introduced in the gateway configuration to force this behaviour.Support responses from subgraphs which use the
application/graphql-response+json
content-type header. (#2162)See graphql-over-http spec for more details:
https://graphql.github.io/graphql-over-http/draft/#sec-application-graphql-response-json
Introduce the new
@authenticated
directive for composition (#2644)Users may now compose
@authenticated
applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables authenticated access to specific types and fields via directive applications.The directive is defined as follows:
In order to compose your
@authenticated
usages, you must update your subgraph's federation spec version to v2.5 and add the@authenticated
import to your existing imports like so:@​link(url: "https://specs.apollo.dev/federation/v2.5", import: [..., "@​authenticated"])
Introduce the new
@requiresScopes
directive for composition (#2649)Users may now compose
@requiresScopes
applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables scoped access to specific types and fields via directive applications.The directive is defined as follows:
The
Scope
scalar is effectively aString
, similar to theFieldSet
type.In order to compose your
@requiresScopes
usages, you must update your subgraph's federation spec version to v2.5 and add the@requiresScopes
import to your existing imports like so:@​link(url: "https://specs.apollo.dev/federation/v2.5", import: [..., "@​requiresScopes"])
Patch Changes
fe1e3d7b
,aac2893a
,6b18af50
,9396c0d6
,2b5796a9
,4f3c3b9e
]:v2.4.13
Compare Source
Patch Changes
f2264cf6
]:v2.4.12
Compare Source
Patch Changes
Remove extraneous call to
span.setStatus()
on a span which has already ended. (#2717)In cases where a subgraph responded with an error, we would sometimes try to set
the status of a span which had already ended. This resulted in a warning log to
the console (but no effect otherwise). This warning should no longer happen.
Fix
fallbackPollIntervalInMs
behavior. (#2717)The
fallbackPollIntervalInMs
serves 2 purposes:The second bullet is how the configuration option is documented, but not how it was previously implemented. This change corrects the behavior to respect this configuration if it's provided AND is longer than the Uplink interval.
Updated dependencies [
693c2433
]:v2.4.11
Compare Source
Patch Changes
Reapply #2639: (#2684)
Try reusing named fragments in subgraph fetches even if those fragment only apply partially to the subgraph. Before this change, only named fragments that were applying entirely to a subgraph were tried, leading to less reuse that expected. Concretely, this change can sometimes allow the generation of smaller subgraph fetches.
Additionally, resolve a bug which surfaced in the fragment optimization logic which could result in invalid/incorrect optimizations / fragment reuse.
Updated dependencies [
a740e071
]:v2.4.10
Compare Source
Patch Changes
Revert #2639 from v2.4.9 (#2681)
PR #2639 attempts to resolve issues with query fragment reuse, but we've since turned up multiple issues (at least 1 of which is a regression - see #2680. For now, this reverts it until we resolve the regression for a future patch release.
Updated dependencies [
b6be9f96
]:v2.4.9
Compare Source
Patch Changes
Try reusing named fragments in subgraph fetches even if those fragment only apply partially to the subgraph. Before this change, only named fragments that were applying entirely to a subgraph were tried, leading to less reuse that expected. Concretely, this change can sometimes allow the generation of smaller subgraph fetches. (#2639)
Updated dependencies [
7ac83456
,d60349b3
,1bb7c512
,02eab3ac
,fd4545c2
]:v2.4.8
Compare Source
Patch Changes
62e0d254
,1293034c
,7f1ef73e
,2a97f372
]:v2.4.7
Compare Source
Patch Changes
planning performance), to fix a possibly raised assertion error (with a message of form like
Cannot add selection of field X to selection set of parent type Y
), and to fix a rare issue where an interface or union field was not beingqueried for all the types it should be.
2d44f346
]:v2.4.6
Compare Source
Patch Changes
5cd17e69
,8ca107ac
,e136ad87
]:v2.4.5
Compare Source
Patch Changes
Supersedes v2.4.4 due to a publishing error with no dist/ folder (#2583)
Updated dependencies [
c96e24c4
]:v2.4.4
Compare Source
Patch Changes
assert
function in theDataRewrite.ts
. The incorrect method was imported (due to a bad (#2581)import auto-completion) and went unnoticed, leading to potential build issue.
cb7f414d
]:v2.4.3
Compare Source
Patch Changes
f6a8c1ce
]:apollographql/apollo-server (@apollo/server)
v4.10.1
Compare Source
Patch Changes
72f568e
Thanks @bscherlein! - Improves timing of thewillResolveField
end hook on fields which return Promises resolving to Arrays. This makes the use of thesetCacheHint
method more reliable.v4.10.0
Compare Source
Minor Changes
#7786
869ec98
Thanks @ganemone! - Restore missing v1skipValidation
option asdangerouslyDisableValidation
. Note that enabling this option exposes your server to potential security and unexpected runtime issues. Apollo will not support issues that arise as a result of using this option.#7803
e9a0d6e
Thanks @favna! - allowstringifyResult
to return aPromise<string>
Users who implemented the
stringifyResult
hook can now expect error responses to be formatted with the hook as well. Please take care when updating to this version to ensure this is the desired behavior, or implement the desired behavior accordingly in yourstringifyResult
hook. This was considered a non-breaking change as we consider that it was an oversight in the original PR that introducedstringifyResult
hook.Patch Changes
#7793
9bd7748
Thanks @bnjjj! - General availability of subscription callback protocol#7799
63dc50f
Thanks @stijnbe! - Fix type of ApolloServerPluginUsageReporting reportTimer#7740
fe68c1b
Thanks @barnisanov! - Uninstalledbody-parser
and usedexpress
built-inbody-parser
functionality instead(mainly the json middleware)v4.9.5
Compare Source
Patch Changes
#7741
07585fe39
Thanks @mayakoneval! - Pin major releases of embeddable Explorer & Sandbox code.#7769
4fac1628c
Thanks @cwikla! - Change SchemaReporter.pollTimer from being a NodeJS.Timer to a NodeJS.Timeoutv4.9.4
Compare Source
Patch Changes
#7747
ddce036e1
Thanks @trevor-scheer! - The minimum version ofgraphql
officially supported by Apollo Server 4 as a peer dependency, v16.6.0, contains a serious bug that can crash your Node server. This bug is fixed in the immediate next version,[email protected]
, and we strongly encourage you to upgrade your installation ofgraphql
to at least v16.7.0 to avoid this bug. (For backwards compatibility reasons, we cannot change Apollo Server 4's minimum peer dependency, but will change it when we release Apollo Server 5.)Apollo Server 4 contained a particular line of code that makes triggering this crashing bug much more likely. This line was already removed in Apollo Server v3.8.2 (see #6398) but the fix was accidentally not included in Apollo Server 4. We are now including this change in Apollo Server 4, which will reduce the likelihood of hitting this crashing bug for users of
graphql
v16.6.0. That said, taking this@apollo/server
upgrade does not prevent this bug from being triggered in other ways, and the real fix to this crashing bug is to upgradegraphql
.v4.9.3
Compare Source
Patch Changes
a1c725eaf
Thanks @trevor-scheer! - Ensure API keys are valid header values on startupApollo Server previously performed no sanitization or validation of API keys on startup. In the case that an API key was provided which contained characters that are invalid as header values, Apollo Server could inadvertently log the API key in cleartext.
This only affected users who:
node-fetch
fetcherApollo Server now trims whitespace from API keys and validates that they are valid header values. If an invalid API key is provided, Apollo Server will throw an error on startup.
For more details, see the security advisory:
GHSA-j5g3-5c8r-7qfx
v4.9.2
Compare Source
Patch Changes
#7699
62e7d940d
Thanks @trevor-scheer! - Fix error path attachment for list itemsPreviously, when errors occurred while resolving a list item, the trace builder would fail to place the error at the correct path and just default to the root node with a warning message:
This change places these errors at their correct paths and removes the log.
v4.9.1
Compare Source
Patch Changes
ebfde0007
Thanks @trevor-scheer! - Add missingnonce
onscript
tag for non-embedded landing pagev4.9.0
Compare Source
Minor Changes
#7617
4ff81ca50
Thanks @trevor-scheer! - Introduce newApolloServerPluginSubscriptionCallback
plugin. This plugin implements the subscription callback protocol which is used by Apollo Router. This feature implements subscriptions over HTTP via a callback URL which Apollo Router registers with Apollo Server. This feature is currently in preview and is subject to change.You can enable callback subscriptions like so:
Note that there is currently no tracing or metrics mechanism in place for callback subscriptions. Additionally, this plugin "intercepts" callback subscription requests and bypasses some of Apollo Server's internals. The result of this is that certain plugin hooks (notably
executionDidStart
andwillResolveField
) will not be called when handling callback subscription requests or when sending subscription events.For more information on the subscription callback protocol, visit the docs:
https://www.apollographql.com/docs/router/executing-operations/subscription-callback-protocol/
Patch Changes
4784f46fb
Thanks @renovate! - Update graphql-http dependencyv4.8.1
Compare Source
Patch Changes
42fc65cb2
Thanks @trevor-scheer! - Update test suite for compatibility with Node v20v4.8.0
Compare Source
Minor Changes
#7634
f8a8ea08f
Thanks @dfperry5! - Updating the ApolloServer constructor to take in a stringifyResult function that will allow a consumer to pass in a function that formats the result of an http query.Usage:
v4.7.5
Compare Source
Patch Changes
#7614
4fadf3ddc
Thanks @Cellule! - Publish TypeScript typings for CommonJS modules output.This allows TypeScript projects that use CommonJS modules with
moduleResolution: "node16"
ormoduleResolution: "nodeNext"
to correctly resolves the typings of apollo's packages as CommonJS instead of ESM.
Updated dependencies [
4fadf3ddc
]:v4.7.4
Compare Source
Patch Changes
0adaf80d1
Thanks @trevor-scheer! - Address Content Security Policy issuesThe previous implementation of CSP nonces within the landing pages did not take full advantage of the security benefit of using them. Nonces should only be used once per request, whereas Apollo Server was generating one nonce and reusing it for the lifetime of the instance. The reuse of nonces degrades the security benefit of using them but does not pose a security risk on its own. The CSP provides a defense-in-depth measure against a potential XSS, so in the absence of a known XSS vulnerability there is likely no risk to the user.
The mentioned fix also coincidentally addresses an issue with using crypto functions on startup within Cloudflare Workers. Crypto functions are now called during requests only, which resolves the error that Cloudflare Workers were facing. A recent change introduced a
precomputedNonce
configuration option to mitigate this issue, but it was an incorrect approach given the nature of CSP nonces. This configuration option is now deprecated and should not be used for any reason since it suffers from the previously mentioned issue of reusing nonces.Additionally, this change adds other applicable CSPs for the scripts, styles, images, manifest, and iframes that the landing pages load.
A final consequence of this change is an extension of the
renderLandingPage
plugin hook. This hook can now return an object with anhtml
property which returns aPromise<string>
in addition to astring
(which was the only option before).v4.7.3
Compare Source
Patch Changes
#7601
75b668d9e
Thanks @trevor-scheer! - Provide a new configuration option for landing page pluginsprecomputedNonce
which allows users to provide a nonce and avoid calling intouuid
functions on startup. This is useful for Cloudflare Workers where random number generation is not available on startup (only during requests). Unless you are using Cloudflare Workers, you can ignore this change.The example below assumes you've provided a
PRECOMPUTED_NONCE
variable in yourwrangler.toml
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate. View repository job log here.