Skip to content
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 next with main #3107

Merged
merged 50 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
53f28c9
docs: quickstart fast follows (#3051)
Meschreiber Jun 27, 2024
5a1be37
release: on branch main (#3044)
github-actions[bot] Jun 28, 2024
a4e105e
Don't put join__enumValue onto an EnumValue if all subgraphs who have…
clenfest Jun 28, 2024
bc79013
Revert #3054 (#3063)
sachindshinde Jul 8, 2024
edd5afc
Run "npx changeset pre enter beta"
sachindshinde Jul 8, 2024
f753d55
Add ability to omit join__ directives from being cloned (#3053)
clenfest Jul 8, 2024
37802ca
Use a `Set` for referencers (#3056)
clenfest Jul 8, 2024
3af7905
Create changeset for #3056 (#3067)
sachindshinde Jul 8, 2024
860aace
Avoid sparsely-populated arrays in query graph cache (#3066)
sachindshinde Jul 8, 2024
38debcf
Wrap dead-end logic with closures (#3068)
sachindshinde Jul 8, 2024
8ee7b95
Avoid re-filtering NamedType objects in Merger.merge.
benjamn Jun 27, 2024
60ba870
Use sparse Map instead of large sources arrays during merge.
benjamn Jul 2, 2024
4b04118
Do more work in addFieldsShallow method.
benjamn Jul 2, 2024
eca8ce6
More comments about Sources<T> handling.
benjamn Jul 8, 2024
f5f6a79
Add changeset entry
sachindshinde Jul 8, 2024
3dff8a3
Merge pull request #3069 from apollographql/benjamn/sparse-map-mergeT…
sachindshinde Jul 8, 2024
bf362da
Only run validateOverride when the coordinate has an override in some…
clenfest Jul 8, 2024
67b70c6
Add changeset entry
sachindshinde Jul 9, 2024
bda679f
Merge pull request #3070 from apollographql/clenfest/validateOverride
sachindshinde Jul 9, 2024
98ee979
inconsistent value type hints should not appear per subgraph
clenfest Jul 8, 2024
42bd27a
Add changeset entry
sachindshinde Jul 9, 2024
2f436ba
Merge pull request #3071 from apollographql/clenfest/inconsistent_fie…
sachindshinde Jul 9, 2024
f560372
release: on branch version-2.8.3-beta (beta) (#3065)
github-actions[bot] Jul 9, 2024
07c122a
docs: update router terms (#3072)
Meschreiber Jul 10, 2024
0f0c7aa
Update "Who is Apollo" (#3073)
Meschreiber Jul 10, 2024
2048ae4
Fix missing sources computation for composition hints/errors (#3075)
sachindshinde Jul 11, 2024
f376447
Create changeset for #3075 (#3076)
sachindshinde Jul 11, 2024
47d4d79
release: on branch version-2.8.3-beta (beta) (#3077)
github-actions[bot] Jul 11, 2024
50d648c
dummy changeset (#3078)
clenfest Jul 11, 2024
5fd0028
release: on branch version-2.8.3-beta (beta) (#3079)
github-actions[bot] Jul 11, 2024
e3b2542
docs: update quickstart for new UI (#3062)
Meschreiber Jul 11, 2024
7e4df3d
Update README.md with summit callout (#3081)
R4ph-t Jul 12, 2024
6b1d14d
docs: add _redirect (#3082)
Meschreiber Jul 12, 2024
759bf9d
Run "npx changeset pre exit"
sachindshinde Jul 12, 2024
42aac5f
Merge branch 'main' into version-2.8.3-beta
sachindshinde Jul 12, 2024
d6b707a
Merge pull request #3084 from apollographql/version-2.8.3-beta
sachindshinde Jul 12, 2024
1a55925
release: on branch main (#3055)
github-actions[bot] Jul 12, 2024
672aca7
Make SchemaUpgrader faster (#3057)
clenfest Jul 15, 2024
ed9561c
chore(docs): rename supported subgraphs to compatible subgraphs (#3088)
dariuszkuc Jul 17, 2024
f91cbd7
docs: add redirect and update links (#3089)
Meschreiber Jul 17, 2024
1e6cb9c
docs: split "Advanced Entities" guide into use-case focused pages (#3…
Meschreiber Jul 17, 2024
0cad761
Fix entity interface links (#3091)
Meschreiber Jul 18, 2024
4d9e0f6
Allow @interfaceObject to stand in for all runtime types (#3087)
clenfest Jul 19, 2024
4658fea
Context names don't allow underscores. Change docs to be valid (#3092)
clenfest Jul 19, 2024
5f4bb16
Don't ever add @shareable to subscription fields during schema upgrad…
clenfest Jul 24, 2024
bb26a78
add descriptions for subgraph directives (#3095)
cheapsteak Jul 24, 2024
6c0f5f2
Fix links in federation docs (#3097)
sketchyy Jul 25, 2024
2d53217
Update define-advanced-keys.mdx (#3098)
torressam333 Jul 25, 2024
38beaa2
release: on branch main (#3085)
github-actions[bot] Jul 25, 2024
cae9be3
docs: copyedit quickstart (#3105)
shorgi Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/calm-candles-rest.md

This file was deleted.

2 changes: 1 addition & 1 deletion .cspell/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ overrides:
- "\\]\\([^)]+\\)"
- "youTubeID=.+/>"
# Ignore user and repo names in GitHub links to supported subgraph libraries.
- filename: '**/supported-subgraphs.md'
- filename: '**/compatible-subgraphs.md'
ignoreRegExpList:
- "Github: <a .+</a>"
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

[![CircleCI](https://circleci.com/gh/apollographql/federation/tree/main.svg?style=shield)](https://circleci.com/gh/apollographql/federation/tree/main) [![Netlify Status](https://api.netlify.com/api/v1/badges/3a012f93-2d02-41f7-bb2b-848cf005b831/deploy-status)](https://app.netlify.com/sites/apollo-federation-docs/deploys)

---

**Announcement:**
Join 1000+ engineers at GraphQL Summit for talks, workshops, and office hours, Oct 8-10 in NYC. [Get your pass here ->](https://summit.graphql.com/?utm_campaign=github_federation_readme)

---

# Apollo Federation

Apollo Federation is an architecture for declaratively composing APIs into a unified graph. Each team can own their slice of the graph independently, empowering them to deliver autonomously and incrementally.
Expand Down Expand Up @@ -29,11 +36,11 @@ If you ever have any problems, questions, or ideas, the maintainers of this proj

## Who is Apollo?

[Apollo](https://apollographql.com/) builds open-source software and a graph platform to unify GraphQL across your apps and services. We help you ship faster with:
[Apollo](https://apollographql.com/) builds open-source tools and commercial services to make application development easier, better, and accessible to more people. We help you ship faster with:

* [GraphOS](https://www.apollographql.com/docs/graphos) – A free, end-to-end platform for managing your GraphQL lifecycle. Track your GraphQL schemas in a hosted registry to create a source of truth for everything in your graph. GraphOS provides an IDE (Apollo Explorer) so you can explore data, collaborate on queries, observe usage, and safely make schema changes.
* [Apollo Federation](https://www.apollographql.com/apollo-federation) – The industry-standard open architecture for building a distributed graph. Use Apollo’s to compose a unified graph from multiple subgraphs, determine a query plan, and route requests across your services.
* [Apollo Client](https://www.apollographql.com/apollo-client/) – The most popular GraphQL client for the web. Apollo also builds and maintains [Apollo iOS](https://github.com/apollographql/apollo-ios) and [Apollo Android](https://github.com/apollographql/apollo-android).
* [GraphOS](https://www.apollographql.com/graphos) - The platform for building, managing, and scaling a supergraph: a unified network of your organization's microservices and their data sources—all composed into a single distributed API.
* [Apollo Federation](https://www.apollographql.com/federation) – The industry-standard open architecture for building a distributed graph. Use Apollo’s gateway to compose a unified graph from multiple subgraphs, determine a query plan, and route requests across your services.
* [Apollo Client](https://github.com/apollographql/apollo-client) – The most popular GraphQL client for the web. Apollo also builds and maintains [Apollo iOS](https://github.com/apollographql/apollo-ios) and [Apollo Kotlin](https://github.com/apollographql/apollo-kotlin).
* [Apollo Server](https://www.apollographql.com/docs/apollo-server/) – A production-ready JavaScript GraphQL server that connects to any microservice, API, or database. Compatible with all popular JavaScript frameworks and deployable in serverless environments.

## Learn how to build with Apollo
Expand Down
78 changes: 78 additions & 0 deletions composition-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,83 @@
# CHANGELOG for `@apollo/composition`

## 2.8.4

### Patch Changes

- When doing interface type intersection detection, allow @interfaceObject to stand in for any type ([#3087](https://github.com/apollographql/federation/pull/3087))

- Updated dependencies [[`5f4bb160d024678d6facd471c43c8ec61c86e701`](https://github.com/apollographql/federation/commit/5f4bb160d024678d6facd471c43c8ec61c86e701), [`672aca7cbeb0a6a38586357a4e154f2dd91caa0c`](https://github.com/apollographql/federation/commit/672aca7cbeb0a6a38586357a4e154f2dd91caa0c)]:
- @apollo/federation-internals@2.8.4
- @apollo/query-graphs@2.8.4

## 2.8.3

### Patch Changes

- Error messages are now lazily evaluated for satisfiability validations. ([#3068](https://github.com/apollographql/federation/pull/3068))

- Query graph caches now use maps instead of sparsely-populated arrays for per-subgraph data. ([#3066](https://github.com/apollographql/federation/pull/3066))

- Add a fast path to skip override validation for fields without any subgraph `@override`s. ([#3070](https://github.com/apollographql/federation/pull/3070))

- Type merging now uses maps instead of sparsely-populated arrays for per-subgraph data. ([#3069](https://github.com/apollographql/federation/pull/3069))

- Stop duplicating hints for inconsistent value type fields per subgraph. ([#3071](https://github.com/apollographql/federation/pull/3071))

- Fix logic to compute missing subgraphs when generating composition hints/errors ([#3076](https://github.com/apollographql/federation/pull/3076))

- Use sets instead of arrays for tracking schema type/directive referencers. ([#3067](https://github.com/apollographql/federation/pull/3067))

- Updated dependencies [[`38debcf2f9af1a719bd1c8acbd9335efa8427ddb`](https://github.com/apollographql/federation/commit/38debcf2f9af1a719bd1c8acbd9335efa8427ddb), [`50d648ccffb05591878de75dc5522914ed48698f`](https://github.com/apollographql/federation/commit/50d648ccffb05591878de75dc5522914ed48698f), [`860aace9904e787f9bf05aad94be5b5920f10543`](https://github.com/apollographql/federation/commit/860aace9904e787f9bf05aad94be5b5920f10543), [`f753d55e9a49d11389ee4f8d7976533447e95ede`](https://github.com/apollographql/federation/commit/f753d55e9a49d11389ee4f8d7976533447e95ede), [`3af790517d662f3bec9064c0bf243014c579e9cd`](https://github.com/apollographql/federation/commit/3af790517d662f3bec9064c0bf243014c579e9cd)]:
- @apollo/query-graphs@2.8.3
- @apollo/federation-internals@2.8.3

## 2.8.3-beta.2

### Patch Changes

- Updated dependencies [[`50d648ccffb05591878de75dc5522914ed48698f`](https://github.com/apollographql/federation/commit/50d648ccffb05591878de75dc5522914ed48698f)]:
- @apollo/federation-internals@2.8.3-beta.2
- @apollo/query-graphs@2.8.3-beta.2

## 2.8.3-beta.1

### Patch Changes

- Fix logic to compute missing subgraphs when generating composition hints/errors ([#3076](https://github.com/apollographql/federation/pull/3076))

- Updated dependencies []:
- @apollo/federation-internals@2.8.3-beta.1
- @apollo/query-graphs@2.8.3-beta.1

## 2.8.3-beta.0

### Patch Changes

- Error messages are now lazily evaluated for satisfiability validations. ([#3068](https://github.com/apollographql/federation/pull/3068))

- Query graph caches now use maps instead of sparsely-populated arrays for per-subgraph data. ([#3066](https://github.com/apollographql/federation/pull/3066))

- Add a fast path to skip override validation for fields without any subgraph `@override`s. ([#3070](https://github.com/apollographql/federation/pull/3070))

- Type merging now uses maps instead of sparsely-populated arrays for per-subgraph data. ([#3069](https://github.com/apollographql/federation/pull/3069))

- Stop duplicating hints for inconsistent value type fields per subgraph. ([#3071](https://github.com/apollographql/federation/pull/3071))

- Use sets instead of arrays for tracking schema type/directive referencers. ([#3067](https://github.com/apollographql/federation/pull/3067))

- Updated dependencies [[`38debcf2f9af1a719bd1c8acbd9335efa8427ddb`](https://github.com/apollographql/federation/commit/38debcf2f9af1a719bd1c8acbd9335efa8427ddb), [`860aace9904e787f9bf05aad94be5b5920f10543`](https://github.com/apollographql/federation/commit/860aace9904e787f9bf05aad94be5b5920f10543), [`f753d55e9a49d11389ee4f8d7976533447e95ede`](https://github.com/apollographql/federation/commit/f753d55e9a49d11389ee4f8d7976533447e95ede), [`3af790517d662f3bec9064c0bf243014c579e9cd`](https://github.com/apollographql/federation/commit/3af790517d662f3bec9064c0bf243014c579e9cd)]:
- @apollo/query-graphs@2.8.3-beta.0
- @apollo/federation-internals@2.8.3-beta.0

## 2.8.2

### Patch Changes

- Updated dependencies [[`b2e5ab66f84688ec304cfcf2c6f749c86aded549`](https://github.com/apollographql/federation/commit/b2e5ab66f84688ec304cfcf2c6f749c86aded549)]:
- @apollo/federation-internals@2.8.2
- @apollo/query-graphs@2.8.2

## 2.8.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions composition-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/composition",
"version": "2.8.1",
"version": "2.8.4",
"description": "Apollo Federation composition utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -27,8 +27,8 @@
"access": "public"
},
"dependencies": {
"@apollo/federation-internals": "2.8.1",
"@apollo/query-graphs": "2.8.1"
"@apollo/federation-internals": "2.8.4",
"@apollo/query-graphs": "2.8.4"
},
"peerDependencies": {
"graphql": "^16.5.0"
Expand Down
69 changes: 69 additions & 0 deletions composition-js/src/__tests__/compose.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5220,4 +5220,73 @@ describe('@source* directives', () => {
);
});
});

it('fed-354 repro @interfaceObject failure', () => {
const subgraph1 = {
name: 'Subgraph1',
url: 'https://Subgraph1',
typeDefs: gql`
type Query {
error_query: TicketField!
}

type User @interfaceObject @key(fields: "id") {
id: ID!
}

interface TicketField {
id: ID!
createdBy: User
}

type TextTicketField implements TicketField @key(fields: "id") @shareable {
id: ID!
createdBy: User
}
`
};

const subgraph2 = {
name: 'Subgraph2',
url: 'https://Subgraph2',
typeDefs: gql`
interface Ticket @key(fields : "id", resolvable : true) {
id: ID!
}

interface User @key(fields : "id", resolvable : true) {
id: ID!
requestedTickets: [Ticket!]!
}

interface TicketField {
createdBy: User
id: ID!
}

type TextTicketField implements TicketField @shareable {
createdBy: User
id: ID!
}

type Customer implements User @key(fields : "id", resolvable : true) @shareable {
id: ID!
requestedTickets: [Ticket!]!
}

type Agent implements User @key(fields : "id", resolvable : true) @shareable {
id: ID!
requestedTickets: [Ticket!]!
}

type Question implements Ticket @key(fields : "id", resolvable : true) {
fields: [TicketField!]!
id: ID!
}
`
};

const result = composeAsFed2Subgraphs([subgraph1, subgraph2]);
assertCompositionSuccess(result);
});
});
5 changes: 3 additions & 2 deletions composition-js/src/composeDirectiveManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import { GraphQLError } from 'graphql';
import { CompositionHint, HINTS } from './hints';
import { MismatchReporter } from './merging/reporter';
import { sourcesFromArray } from './merging';

/**
* Return true if the directive from the same core feature has a different name in the subgraph
Expand Down Expand Up @@ -367,7 +368,7 @@ export class ComposeDirectiveManager {
this.mismatchReporter.reportMismatchErrorWithoutSupergraph(
ERRORS.DIRECTIVE_COMPOSITION_ERROR,
'Composed directive is not named consistently in all subgraphs',
this.subgraphs.values()
sourcesFromArray(this.subgraphs.values()
.map(sg => {
const item = items.find(item => sg.name === item.sgName);
return item ? {
Expand All @@ -384,7 +385,7 @@ export class ComposeDirectiveManager {
sourceAST,
item: val.item,
} : undefined;
}),
})),
(elt) => elt ? `"@${elt.item.directiveNameAs}"` : undefined
);
}
Expand Down
2 changes: 1 addition & 1 deletion composition-js/src/merging/coreDirectiveCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function collectCoreDirectivesToCompose(
const source = features.sourceFeature(directive);
// We ignore directives that are not "core" ones, or the ones that are defined but unused (note that this
// happen to ignore execution directives as a by-product)
if (!source || directive.applications().length === 0) {
if (!source || directive.applications().size === 0) {
continue;
}

Expand Down
Loading
Loading