Skip to content

merge main into next#3151

Merged
lennyburdette merged 11 commits intonextfrom
lb/merge-main
Sep 23, 2024
Merged

merge main into next#3151
lennyburdette merged 11 commits intonextfrom
lb/merge-main

Conversation

@lennyburdette
Copy link
Contributor

No description provided.

sachindshinde and others added 11 commits September 3, 2024 13:05
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).
#3137)" (#3144)

It turns out #3137 needs a few other changes, and we can't ship those in
a patch, so we're reverting the PR for now.
…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.
The PRs #3134 and #3136 were merged without tests illustrating the bugs
they were fixing. This PR adds tests for two of the bugs fixed by them;
these tests fail on `2.9.0`, but succeed after the aforementioned PRs.
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>
<!--
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)
@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2024

⚠️ No Changeset found

Latest commit: fccf785

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codesandbox-ci
Copy link

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.

@lennyburdette lennyburdette merged commit feb0086 into next Sep 23, 2024
@lennyburdette lennyburdette deleted the lb/merge-main branch September 23, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants