Skip to content

Commit 02de6d4

Browse files
lennyburdetteMeschreiberclenfestshorgipeakematt
authored
merge main into next, bringing in 2.9.3 changes (#3199)
<!-- 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]>
1 parent b117986 commit 02de6d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3351
-3503
lines changed

.changeset/warm-moles-jog.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/gateway": minor
3+
---
4+
5+
Add request parameter to didEncounterError method

.circleci/config.yml

-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: 2.1
22

33
orbs:
44
node: circleci/[email protected]
5-
secops: apollo/[email protected]
65

76
jobs:
87
# Unfortunately cimg/node doesn't tag its images with major only, you have to specify a minor version.
@@ -60,17 +59,3 @@ workflows:
6059
- node/run:
6160
name: Check Prettier (tests)
6261
npm-run: prettier:check
63-
security-scans:
64-
jobs:
65-
- secops/gitleaks:
66-
context:
67-
- platform-docker-ro
68-
- github-orb
69-
- secops-oidc
70-
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
71-
git-revision: << pipeline.git.revision >>
72-
- secops/semgrep:
73-
context:
74-
- secops-oidc
75-
- github-orb
76-
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>

.cspell/cspell.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ overrides:
3939
ignoreRegExpList:
4040
- "\\]\\([^)]+\\)"
4141
- "youTubeID=.+/>"
42+
- "WistiaId=.+/>"
4243
# Ignore user and repo names in GitHub links to supported subgraph libraries.
4344
- filename: '**/compatible-subgraphs.md'
4445
ignoreRegExpList:

composition-js/src/__tests__/hints.test.ts

+45-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,51 @@ test('hints on field of object value type not being in all subgraphs', () => {
302302
+ '"T.b" is defined in subgraph "Subgraph1" but not in subgraph "Subgraph2".',
303303
'T'
304304
);
305-
})
305+
});
306+
307+
test('use of federation__key does not raise hint', () => {
308+
const subgraph1 = gql`
309+
extend schema
310+
@link(url: "https://specs.apollo.dev/federation/v2.7")
311+
312+
type Query {
313+
a: Int
314+
}
315+
316+
union U = T
317+
318+
type T @federation__key(fields:"id") {
319+
id: ID!
320+
b: Int
321+
}
322+
`;
323+
324+
const subgraph2 = gql`
325+
extend schema
326+
@link(url: "https://specs.apollo.dev/federation/v2.7")
327+
328+
type Query {
329+
b: Int
330+
}
331+
332+
type T @federation__key(fields:"id") {
333+
id: ID!
334+
c: Int
335+
}
336+
`;
337+
const result = composeServices([
338+
{
339+
name: 'subgraph1',
340+
typeDefs: subgraph1,
341+
},
342+
{
343+
name: 'subgraph2',
344+
typeDefs: subgraph2,
345+
},
346+
]);
347+
assertCompositionSuccess(result);
348+
expect(result).toNotRaiseHints();
349+
});
306350

307351
test('hints on field of interface value type not being in all subgraphs', () => {
308352
const subgraph1 = gql`

composition-js/src/merging/merge.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1098,11 +1098,14 @@ class Merger {
10981098
private hintOnInconsistentEntity(sources: Sources<ObjectType>, dest: ObjectType): boolean {
10991099
const sourceAsEntity: ObjectType[] = [];
11001100
const sourceAsNonEntity: ObjectType[] = [];
1101-
for (const source of sources.values()) {
1101+
for (const [idx, source] of sources.entries()) {
11021102
if (!source) {
11031103
continue;
11041104
}
1105-
if (source.hasAppliedDirective('key')) {
1105+
1106+
const sourceMetadata = this.subgraphs.values()[idx].metadata();
1107+
const keyDirective = sourceMetadata.keyDirective();
1108+
if (source.hasAppliedDirective(keyDirective)) {
11061109
sourceAsEntity.push(source);
11071110
} else {
11081111
sourceAsNonEntity.push(source);

docs/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

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

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

7-
* https://www.apollographql.com/docs/federation/
8-
9-
See the [docs site README](https://github.com/apollographql/docs) for local installation and development.
7+
* https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/federation
8+
* https://www.apollographql.com/docs/graphos/reference/federation/versions
9+
* https://www.apollographql.com/docs/graphos/reference/migration/to-federation-version-2

docs/shared/diagrams/federation-architecture.mdx

-14
This file was deleted.

docs/shared/diagrams/managed-federation.mdx

-17
This file was deleted.

docs/source/_redirects

-36
This file was deleted.

0 commit comments

Comments
 (0)