Merged
Conversation
This PR fixes a bug where `getLocallySatisfiableKey()` would mistakenly consider non-resolvable keys, which would sometimes result in self jumps for `@requires` using non-resolvable keys.
While reviewing recent code changes that released in `2.9.0`, I noticed a few bugs in the code. This PR contains fixes for subgraph extraction bugs. Specifically, this PR updates subgraph extraction to use pre-existing functions/patterns instead of repeating logic, to avoid copy/pasting and bugs/divergence (the copied logic wasn't looking at spec renaming, for example).
…raction in composition (#3134) While reviewing recent code changes that released in `2.9.0`, I noticed a few bugs in the code, so I've pushed some fixes for them in this PR (along with some fixes for more ancient bugs). I'll comment on the code with more details, but to summarize the fixes: - Value comparison/default value application has been updated to handle `null`s/`undefined`s better. - Composition argument strategy code has been refactored to handle nullability more cleanly (and fix some bugs around nullability). - Note I've commented out the unused `SUM` strategy, as using it currently wouldn't yield expected results since directive applications are deduped before being merged. - The logic that applies `@link` applications to the supergraph schema for supergraph specs needed by subgraph directives has been updated to handle specs that have multiple directives that need composing (the behavior before was adding spurious directive definitions to the supergraph schema). - Some ancient logic around computing directive/type names for `@core`/`@link` was off.
Relax error for detecting whether `@external` field matches. If the external field has extra optional parameters, allow it to pass composition as being able to pass the parameter is not necessary for a required field.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @apollo/composition@2.9.1 ### Patch Changes - Fix bugs in composition when merging nulls in directive applications and when handling renames. ([#3134](#3134)) - Updated dependencies \[[`b8e4ab5352a4dfd262af49493fdd42e86e5e3d99`](b8e4ab5), [`e6c05b6c96023aa3dec79889431f8217fcb3806d`](e6c05b6)]: - @apollo/federation-internals@2.9.1 - @apollo/query-graphs@2.9.1 ## @apollo/gateway@2.9.1 ### Patch Changes - Fix bugs in composition when merging nulls in directive applications and when handling renames. ([#3134](#3134)) - Updated dependencies \[[`b8e4ab5352a4dfd262af49493fdd42e86e5e3d99`](b8e4ab5), [`e6c05b6c96023aa3dec79889431f8217fcb3806d`](e6c05b6)]: - @apollo/federation-internals@2.9.1 - @apollo/composition@2.9.1 - @apollo/query-planner@2.9.1 ## @apollo/federation-internals@2.9.1 ### Patch Changes - Fix edge cases for subgraph extraction logic when using spec renaming or specs URLs that look similar to `specs.apollo.dev`. ([#3136](#3136)) - Fix bugs in composition when merging nulls in directive applications and when handling renames. ([#3134](#3134)) ## @apollo/query-graphs@2.9.1 ### Patch Changes - Updated dependencies \[[`b8e4ab5352a4dfd262af49493fdd42e86e5e3d99`](b8e4ab5), [`e6c05b6c96023aa3dec79889431f8217fcb3806d`](e6c05b6)]: - @apollo/federation-internals@2.9.1 ## @apollo/query-planner@2.9.1 ### Patch Changes - Updated dependencies \[[`b8e4ab5352a4dfd262af49493fdd42e86e5e3d99`](b8e4ab5), [`e6c05b6c96023aa3dec79889431f8217fcb3806d`](e6c05b6)]: - @apollo/federation-internals@2.9.1 - @apollo/query-graphs@2.9.1 ## @apollo/subgraph@2.9.1 ### Patch Changes - Updated dependencies \[[`b8e4ab5352a4dfd262af49493fdd42e86e5e3d99`](b8e4ab5), [`e6c05b6c96023aa3dec79889431f8217fcb3806d`](e6c05b6)]: - @apollo/federation-internals@2.9.1 ## apollo-federation-integration-testsuite@2.9.1 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Updates links
<!--
First, 🌠 thank you 🌠 for taking the time to consider a contribution to
Apollo!
Here are some important details to follow:
* ⏰ Your time is important
To save your precious time, if the contribution you are making will
take more than an hour, please make sure it has been discussed in an
issue first. This is especially true for feature requests!
* 💡 Features
Feature requests can be created and discussed within a GitHub Issue.
Be sure to search for existing feature requests (and related issues!)
prior to opening a new request. If an existing issue covers the need,
please upvote that issue by using the 👍 emote, rather than opening a
new issue.
* 🕷 Bug fixes
These can be created and discussed in this repository. When fixing a
bug,
please _try_ to add a test which verifies the fix. If you cannot, you
should
still submit the PR but we may still ask you (and help you!) to create a
test.
* Federation versions
Please make sure you're targeting the federation version you're opening
the PR for. Federation 2 (alpha) is currently located on the `main`
branch and prior versions of Federation live on the `version-0.x`
branch.
* 📖 Contribution guidelines
Follow
https://github.com/apollographql/federation/blob/HEAD/CONTRIBUTING.md
when submitting a pull request. Make sure existing tests still pass, and
add
tests for all new behavior.
* ✏️ Explain your pull request
Describe the big picture of your changes here to communicate to what
your pull request is meant to accomplish. Provide 🔗 links 🔗 to
associated issues!
We hope you will find this to be a positive experience! Open source
contribution can be intimidating and we hope to alleviate that pain as
much
as possible. Without following these guidelines, you may be missing
context
that can help you succeed with your contribution, which is why we
encourage
discussion first. Ultimately, there is no guarantee that we will be able
to
merge your pull-request, but by following these guidelines we can try to
avoid disappointment.
-->
Fixing a broken link to Federation Quickstart. Broken link appears [here
in the
docs](https://www.apollographql.com/docs/federation/building-supergraphs/router/#choosing-a-router-library)
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
trevor-scheer
approved these changes
Sep 23, 2024
sachindshinde
approved these changes
Sep 23, 2024
This file contains hidden or 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
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.
No description provided.