Skip to content

Commit

Permalink
merge main into next, bringing in 2.9.3 changes (#3199)
Browse files Browse the repository at this point in the history
<!--
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.

-->

---------

Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
Co-authored-by: Chris Lenfest <[email protected]>
Co-authored-by: Edward Huang <[email protected]>
Co-authored-by: Matt Peake <[email protected]>
Co-authored-by: kamila-brylewska-zendesk <[email protected]>
  • Loading branch information
6 people authored Jan 10, 2025
1 parent b117986 commit 02de6d4
Show file tree
Hide file tree
Showing 62 changed files with 3,351 additions and 3,503 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-moles-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/gateway": minor
---

Add request parameter to didEncounterError method
15 changes: 0 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: 2.1

orbs:
node: circleci/[email protected]
secops: apollo/[email protected]

jobs:
# Unfortunately cimg/node doesn't tag its images with major only, you have to specify a minor version.
Expand Down Expand Up @@ -60,17 +59,3 @@ workflows:
- node/run:
name: Check Prettier (tests)
npm-run: prettier:check
security-scans:
jobs:
- secops/gitleaks:
context:
- platform-docker-ro
- github-orb
- secops-oidc
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
git-revision: << pipeline.git.revision >>
- secops/semgrep:
context:
- secops-oidc
- github-orb
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
1 change: 1 addition & 0 deletions .cspell/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ overrides:
ignoreRegExpList:
- "\\]\\([^)]+\\)"
- "youTubeID=.+/>"
- "WistiaId=.+/>"
# Ignore user and repo names in GitHub links to supported subgraph libraries.
- filename: '**/compatible-subgraphs.md'
ignoreRegExpList:
Expand Down
46 changes: 45 additions & 1 deletion composition-js/src/__tests__/hints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,51 @@ test('hints on field of object value type not being in all subgraphs', () => {
+ '"T.b" is defined in subgraph "Subgraph1" but not in subgraph "Subgraph2".',
'T'
);
})
});

test('use of federation__key does not raise hint', () => {
const subgraph1 = gql`
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.7")
type Query {
a: Int
}
union U = T
type T @federation__key(fields:"id") {
id: ID!
b: Int
}
`;

const subgraph2 = gql`
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.7")
type Query {
b: Int
}
type T @federation__key(fields:"id") {
id: ID!
c: Int
}
`;
const result = composeServices([
{
name: 'subgraph1',
typeDefs: subgraph1,
},
{
name: 'subgraph2',
typeDefs: subgraph2,
},
]);
assertCompositionSuccess(result);
expect(result).toNotRaiseHints();
});

test('hints on field of interface value type not being in all subgraphs', () => {
const subgraph1 = gql`
Expand Down
7 changes: 5 additions & 2 deletions composition-js/src/merging/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1098,11 +1098,14 @@ class Merger {
private hintOnInconsistentEntity(sources: Sources<ObjectType>, dest: ObjectType): boolean {
const sourceAsEntity: ObjectType[] = [];
const sourceAsNonEntity: ObjectType[] = [];
for (const source of sources.values()) {
for (const [idx, source] of sources.entries()) {
if (!source) {
continue;
}
if (source.hasAppliedDirective('key')) {

const sourceMetadata = this.subgraphs.values()[idx].metadata();
const keyDirective = sourceMetadata.keyDirective();
if (source.hasAppliedDirective(keyDirective)) {
sourceAsEntity.push(source);
} else {
sourceAsNonEntity.push(source);
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

This is the documentation **source** for this repository.

The **deployed** version of the documentation for this repository is available at:
Pages from this directory are deployed in the following documentation sections:

* https://www.apollographql.com/docs/federation/

See the [docs site README](https://github.com/apollographql/docs) for local installation and development.
* https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/federation
* https://www.apollographql.com/docs/graphos/reference/federation/versions
* https://www.apollographql.com/docs/graphos/reference/migration/to-federation-version-2
14 changes: 0 additions & 14 deletions docs/shared/diagrams/federation-architecture.mdx

This file was deleted.

17 changes: 0 additions & 17 deletions docs/shared/diagrams/managed-federation.mdx

This file was deleted.

36 changes: 0 additions & 36 deletions docs/source/_redirects

This file was deleted.

Loading

0 comments on commit 02de6d4

Please sign in to comment.