Skip to content

Commit

Permalink
Merge branch 'main' into trevor/missing-internals-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-scheer authored Apr 13, 2022
2 parents 869c307 + 9fbb9ef commit 0694064
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 37 deletions.
66 changes: 47 additions & 19 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,77 @@ new Federation 2 (on the [main branch](https://github.com/apollographql/federati
## Table of Contents

* [What's next](#whats-next)
* [Federation 2 GA](#federation-2-ga)
* [Federation 2 Post-GA](#federation-2-post-ga)
* [Next Release](#next-release)
* [Under Consideration](#under-consideration)

* [Released](#released)
* [Federation 2 GA](#federation-2-ga)
* [Federation 2 Preview](#federation-2-preview)
* [Federation 2 Alpha](#federation-2-alpha)
* [Gateway Performance Enhancements](#gateway-performance-enhancements)
* [Gateway Enhancements](#gateway-enhancements)
* [Federation 1](#federation-1)
* [Subgraph Compatibility Test Results](#subgraph-compatibility-test-results)

## What's Next

### Federation 2 GA
### Next Release

* Incorporate community feedback on Preview
* Type merging that can be relaxed even further with:
* `@inaccessible` - [#1178](https://github.com/apollographql/federation/issues/1178) and [core feature spec](https://specs.apollo.dev/)
* Field migration across subgraphs with `@override` - [#1177](https://github.com/apollographql/federation/issues/1177)
* Updated [Fed 2 docs](https://www.apollographql.com/docs/federation/v2/) & [migration guide](https://www.apollographql.com/docs/federation/v2/federation-2/moving-to-federation-2)
* Enhanced test automation
* `@tag` export to API schema
* Compose user-defined directives in subgraphs

### Federation 2 Post-GA
### Under Consideration

* Compose user-defined directives in subgraphs
* `@defer` support in query planning
* Subscriptions support in query planning
* Entity interfaces can be spread across multiple subgraphs & interface queries with `@interfaceObject` helper.
* Harmonizing shared value types across subgraphs to a canonical desired state.
* Advanced caching, auth, demand control, rate limiting, governance, and more!
* Importing shared types into subgraph schemas, to keep things more DRY.
* `Entity interfaces` can be spread across multiple subgraphs & interface queries.
* Nested `@provides` support beyond what Fed 2 alpha already supports natively.
* Nested `@provides` support beyond what Fed 2 already supports natively.
* Process subgraph and supergraph schemas with a new [core-schema-js](https://github.com/apollographql/core-schema-js) library.
* Expanded use of [core schemas](https://github.com/apollographql/core-schema-js) to compose your own directives in subgraphs.
* Type merging that can be relaxed even further with `@default` - [#1187](https://github.com/apollographql/federation/issues/1187)
* Lots more!

### Under Consideration

* Replace `serviceList` API with more flexible, reactive option - [#1180](https://github.com/apollographql/federation/issues/1180)

## Released

### Federation 2 GA

* Backwards compatible with Federation 1
* [Migration](https://www.apollographql.com/docs/federation/v2/federation-2/moving-to-federation-2) is a simple and incremental process
* [@apollo/gateway v2.0.0](https://www.npmjs.com/package/@apollo/gateway/v/2.0.0?activeTab=versions) supports Fed 1 and Fed 2 supergraphs
* Composition 2.x auto-converts Fed 1 subgraphs with [rover 0.5+](https://www.apollographql.com/docs/rover/getting-started)
* Upgrade subgraphs one at a time with [@apollo/subgraph v2](https://www.npmjs.com/package/@apollo/subgraph/v/2.0.0?activeTab=versions)
* New `@link` directive for subgraphs to `import` [Fed 2 directives](https://github.com/apollographql/federation/blob/main/designs/Federation%202%20GA%20authorship%20UX.md#using-federation-2)
* Build with a smoother developer experience
* Cleaner syntax
* First-class support for shared interfaces, enums, and more

* Deliver smaller increments with better shared types
* Flexible value type merging
* Hide fields with `@inaccessible` - [#1178](https://github.com/apollographql/federation/issues/1178)
* All types shared equally across subgraphs without `extend`
* All fields have a single source of truth by default
* `@shareable` to opt-into denormalization of fields for performance

* Field migration across subgraphs with `@override` - [#1177](https://github.com/apollographql/federation/issues/1177)
* Accepts production traffic without downtime
* Remove the old field with no delivery coordination

* Catch errors sooner with improved static analysis
* More descriptive error messages
* New composition engine validates all theoretically possible queries
* Composition hints to show divergence across merged types

* More subgraphs support Federation 2 syntax
* [18 subgraph-compatible libraries](https://www.apollographql.com/docs/federation/other-servers)
* [Subgraph spec](https://www.apollographql.com/docs/federation/federation-spec)
* Enhanced test automation

### Federation 2 Preview

* [Federation Authorship UX design](https://github.com/apollographql/federation/blob/main/designs/Federation%202%20GA%20authorship%20UX.md)
* New `@link` directive for subgraphs to `import` [using new Fed 2 subgraph syntax](https://github.com/apollographql/federation/blob/main/designs/Federation%202%20GA%20authorship%20UX.md#using-federation-2)
* Enhanced [shared ownership model & field sharing](https://github.com/apollographql/federation/blob/main/designs/Federation%202%20GA%20authorship%20UX.md#field-sharing)
* All fields have a single source of truth by default:
* relax ownership with `@shareable` to denormalize for performance [#1176](https://github.com/apollographql/federation/issues/1176)
Expand Down Expand Up @@ -112,7 +138,7 @@ new Federation 2 (on the [main branch](https://github.com/apollographql/federati

* Let us know what you think on the [Community Forum](https://community.apollographql.com/t/announcing-apollo-federation-2/1821)

### Gateway Performance Enhancements
### Gateway Enhancements

* Improved Gateway performance via new op-shape-based field usage reporting
* With [Apollo Server 3.6+ expensive subgraph traces are not needed](https://www.apollographql.com/docs/apollo-server/api/plugin/usage-reporting/#fieldlevelinstrumentation) for field usage reporting.
Expand All @@ -124,6 +150,8 @@ new Federation 2 (on the [main branch](https://github.com/apollographql/federati
* `make-fetch-happen` does this by default. significant gains in [our benchmark testing](https://www.apollographql.com/blog/announcement/backend/apollo-router-our-graphql-federation-runtime-in-rust/).
* [Gateway 2.x uses `make-fetch-happen` by default](https://github.com/apollographql/federation/pull/1284); [backported to Gateway 0.46](https://github.com/apollographql/federation/blob/version-0.x/gateway-js/CHANGELOG.md#v0460)

* Replace `serviceList` API with more flexible, reactive option - [#1180](https://github.com/apollographql/federation/issues/1180)

### Federation 1

* Originally [released in 2019](https://www.apollographql.com/blog/announcement/apollo-federation-f260cf525d21/), Federation powers some of the largest graphs in the world.
Expand Down
4 changes: 4 additions & 0 deletions composition-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This CHANGELOG pertains only to Apollo Federation packages in the 2.x range. The Federation v0.x equivalent for this package can be found [here](https://github.com/apollographql/federation/blob/version-0.x/federation-js/CHANGELOG.md) on the `version-0.x` branch of this repo.

## v2.0.1

- Use `for: SECURITY` in the core/link directive application in the supergraph for `@inaccessible` [PR #1715](https://github.com/apollographql/federation/pull/1715)

## v2.0.0

- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
Expand Down
2 changes: 1 addition & 1 deletion composition-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/composition",
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Federation composition utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
18 changes: 18 additions & 0 deletions composition-js/src/__tests__/compose.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
buildSubgraph,
extractSubgraphsFromSupergraph,
FEDERATION2_LINK_WTH_FULL_IMPORTS,
inaccessibleIdentity,
InputObjectType,
isObjectType,
ObjectType,
Expand Down Expand Up @@ -2638,6 +2639,23 @@ describe('composition', () => {
);
expect(print(nodes[1])).toMatchString('q2: A');
})

it('uses the SECURITY core purpose for inaccessible in the supergraph', () => {
const subgraphA = {
typeDefs: gql`
type Query {
someField: String!
privateField: String! @inaccessible
}
`,
name: 'subgraphA',
};

const result = composeAsFed2Subgraphs([subgraphA]);
assertCompositionSuccess(result);
const supergraph = result.schema;
expect(supergraph.coreFeatures?.getByIdentity(inaccessibleIdentity)?.purpose).toBe('SECURITY');
});
});

describe('Enum types', () => {
Expand Down
4 changes: 2 additions & 2 deletions composition-js/src/merging/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class Merger {
// pass a `as` to the methods below if necessary. However, as we currently don't propagate any subgraph directives to
// the supergraph outside of a few well-known ones, we don't bother yet.
linkSpec.addToSchema(this.merged);
const errors = linkSpec.applyFeatureToSchema(this.merged, joinSpec, undefined, 'EXECUTION');
const errors = linkSpec.applyFeatureToSchema(this.merged, joinSpec, undefined, joinSpec.defaultCorePurpose);
assert(errors.length === 0, "We shouldn't have errors adding the join spec to the (still empty) supergraph schema");

for (const mergedInfo of MERGED_FEDERATION_DIRECTIVES) {
Expand Down Expand Up @@ -314,7 +314,7 @@ class Merger {
// If we get here with `nameInSupergraph` unset, it means there is no usage for the directive at all and we
// don't bother adding the spec to the supergraph.
if (nameInSupergraph) {
const errors = linkSpec.applyFeatureToSchema(this.merged, specInSupergraph, nameInSupergraph === specInSupergraph.url.name ? undefined : nameInSupergraph);
const errors = linkSpec.applyFeatureToSchema(this.merged, specInSupergraph, nameInSupergraph === specInSupergraph.url.name ? undefined : nameInSupergraph, specInSupergraph.defaultCorePurpose);
assert(errors.length === 0, "We shouldn't have errors adding the join spec to the (still empty) supergraph schema");
this.mergedFederationDirectiveNames.add(nameInSupergraph);
this.mergedFederationDirectiveInSupergraph.set(specInSupergraph.url.name, this.merged.directive(nameInSupergraph)!);
Expand Down
2 changes: 1 addition & 1 deletion federation-integration-testsuite-js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "apollo-federation-integration-testsuite",
"private": true,
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Federation Integrations / Test Fixtures",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions gateway-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This CHANGELOG pertains only to Apollo Federation packages in the 2.x range. The

- Add missing @apollo/federation-internals dependency to gateway [PR #1721](https://github.com/apollographql/federation/pull/1721)

## v2.0.1

- Use `for: SECURITY` in the core/link directive application in the supergraph for `@inaccessible` [PR #1715](https://github.com/apollographql/federation/pull/1715)

## v2.0.0

- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
Expand Down
2 changes: 1 addition & 1 deletion gateway-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/gateway",
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Gateway",
"author": "Apollo <[email protected]>",
"main": "dist/index.js",
Expand Down
4 changes: 4 additions & 0 deletions internals-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG for `@apollo/federation-internals`

## v2.0.1

- Use `for: SECURITY` in the core/link directive application in the supergraph for `@inaccessible` [PR #1715](https://github.com/apollographql/federation/pull/1715)

## v2.0.0

- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
Expand Down
2 changes: 1 addition & 1 deletion internals-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/federation-internals",
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Federation internal utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions internals-js/src/coreSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export abstract class FeatureDefinition {
return features.getByIdentity(this.identity);
}

get defaultCorePurpose(): CorePurpose | undefined {
return undefined;
}

toString(): string {
return `${this.identity}/${this.version}`
}
Expand Down
6 changes: 5 additions & 1 deletion internals-js/src/inaccessibleSpec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FeatureDefinition, FeatureDefinitions, FeatureUrl, FeatureVersion } from "./coreSpec";
import { CorePurpose, FeatureDefinition, FeatureDefinitions, FeatureUrl, FeatureVersion } from "./coreSpec";
import {
ArgumentDefinition,
CoreFeatures,
Expand Down Expand Up @@ -92,6 +92,10 @@ export class InaccessibleSpecDefinition extends FeatureDefinition {
allElementNames(): string[] {
return ['@inaccessible'];
}

get defaultCorePurpose(): CorePurpose | undefined {
return 'SECURITY';
}
}

export const INACCESSIBLE_VERSIONS = new FeatureDefinitions<InaccessibleSpecDefinition>(inaccessibleIdentity)
Expand Down
6 changes: 5 additions & 1 deletion internals-js/src/joinSpec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DirectiveLocation, GraphQLError } from 'graphql';
import { FeatureDefinition, FeatureDefinitions, FeatureUrl, FeatureVersion } from "./coreSpec";
import { CorePurpose, FeatureDefinition, FeatureDefinitions, FeatureUrl, FeatureVersion } from "./coreSpec";
import {
DirectiveDefinition,
EnumType,
Expand Down Expand Up @@ -176,6 +176,10 @@ export class JoinSpecDefinition extends FeatureDefinition {
ownerDirective(schema: Schema): DirectiveDefinition<{graph: string}> | undefined {
return this.directive(schema, 'owner');
}

get defaultCorePurpose(): CorePurpose | undefined {
return 'EXECUTION';
}
}

// Note: This declare a no-yet-agreed-upon join spec v0.2, that:
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions query-graphs-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG for `@apollo/query-graphs`

## v2.0.1

- Released in sync with other federation packages but no changes to this package.

## v2.0.0

- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
Expand Down
2 changes: 1 addition & 1 deletion query-graphs-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/query-graphs",
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Federation library to work with 'query graphs'",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions query-planner-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This CHANGELOG pertains only to Apollo Federation packages in the 2.x range. The Federation v0.x equivalent for this package can be found [here](https://github.com/apollographql/federation/blob/version-0.x/query-planner-js/CHANGELOG.md) on the `version-0.x` branch of this repo.

## v2.0.1

- Released in sync with other federation packages but no changes to this package.

## v2.0.0

- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
Expand Down
2 changes: 1 addition & 1 deletion query-planner-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/query-planner",
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Query Planner",
"author": "Apollo <[email protected]>",
"main": "dist/index.js",
Expand Down
4 changes: 4 additions & 0 deletions subgraph-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This CHANGELOG pertains only to Apollo Federation packages in the 2.x range. The Federation v0.x equivalent for this package can be found [here](https://github.com/apollographql/federation/blob/version-0.x/subgraph-js/CHANGELOG.md) on the `version-0.x` branch of this repo.

## v2.0.1

- Released in sync with other federation packages but no changes to this package.

## v2.0.0

- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
Expand Down
2 changes: 1 addition & 1 deletion subgraph-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/subgraph",
"version": "2.0.0",
"version": "2.0.1",
"description": "Apollo Subgraph Utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 0694064

Please sign in to comment.