Releases: graphql-hive/federation-composition
v0.20.2
Patch Changes
-
#198
1b98c17Thanks @User!, @User!! - Fix public schema SDL in case a object type implements an inaccessible interface.Composing the following subgraph:
schema @link( url: "https://specs.apollo.dev/federation/v2.3" import: ["@inaccessible"] ) { query: Query } type Query { } interface Node @inaccessible { id: ID! } type User implements Node { id: ID! }
now result in the following valid public SDL:
type Query { } - type User implements Node { + type User { id: ID! }
v0.20.1
v0.20.0
Minor Changes
-
#180
a208f1cThanks @n1ru4l! - AddcomposeSchemaContractfunction for composing schema contracts.Running the following script:
import { composeSchemaContract } from "@theguild/federation-composition"; import { parse } from "graphql"; const result = composeSchemaContract( [ { name: "a", typeDefs: parse(/* GraphQL */ ` type Query { a: String @tag(name: "public") } `), url: "a.localhost", }, { name: "b", typeDefs: parse(/* GraphQL */ ` type Query { b: String } `), url: "b.localhost", }, ], /** Tags to include and exclude */ { include: new Set(["public"]), exclude: new Set(), }, /** Exclude unreachable types */ true, ); console.log(result.publicSdl);
Will result in the output containing only the fields tagged with
public:type Query { a: String! }
v0.19.1
v0.19.0
v0.18.5
Patch Changes
-
#151
f9b9908Thanks @n1ru4l! - Fix issue where the satisfiability check raised an exception for fields that share different object type and interface definitions across subgraphs. -
#152
e4440a1Thanks @n1ru4l! - Fix issue where scalar type marked with@inaccessibledoes not fail the composition if all usages are not marked with@inaccessible.Composing the following subgraphs resulted in an invalid supergraph instead of failing the composition.
# Subgraph A extend schema @link( url: "https://specs.apollo.dev/federation/v2.9" import: ["@inaccessible"] ) type Query { a: Foo } scalar Foo
# Subgraph B extend schema @link( url: "https://specs.apollo.dev/federation/v2.9" import: ["@inaccessible"] ) type Query { b: String } scalar Foo @inaccessible
Now it correctly raises a composition error with the message
Type "Foo" is @inaccessible but is referenced by "Query.a", which is in the API schema..
v0.18.4
Patch Changes
-
#146
55b48e9Thanks @n1ru4l! - Resolve usage of@requiresFieldSetwith a union field selection to raise anEXTERNAL_UNUSEDerror. -
#150
9bd8016Thanks @n1ru4l! - Fix incorrectly raisedIMPLEMENTED_BY_INACCESSIBLEerror for inaccessible object fields where the object type is inaccessible.For example the following subgraph, will no longer result in the error
Field B.id is @inaccessible but implements the interface field Node.id, which is in the API schema..schema @link(url: "https://specs.apollo.dev/federation/v2.9", import: ["@tag"]) { query: Query } type Query { b(id: ID! @federation__inaccessible): B @federation__inaccessible a(id: ID!): A } type B implements Node @federation__inaccessible { id: ID! @federation__inaccessible } type A implements Node { id: ID! } interface Node { id: ID! }
-
#147
8c5bc0cThanks @n1ru4l! - Add support for@providesfragment selection sets on union type fields.type Query { media: [Media] @shareable @provides(fields: "... on Book { title }") } union Media = Book | Movie
v0.18.3
v0.18.2
Patch Changes
-
#141
fdb491fThanks @ardatan! - Fixes the issue where the composition gives errors in case of the following:extend schema @link( url: "https://specs.apollo.dev/federation/v2.7" import: ["@key", "@composeDirective"] ) @link(url: "https://myspecs.dev/myDirective/v1.0", import: ["@myDirective"]) @composeDirective(name: "@myDirective") directive @myDirective(myarg: [MyEnum!]!) on OBJECT # A directive with a non-nullable list argument of non-nullable enums enum MyEnum { MY_ENUM_VALUE } type Query { myRootField: MyObject } type MyObject @myDirective(myarg: []) { myField: String }
v0.18.1
Patch Changes
-
#129
9382277Thanks @kamilkisiela! - Ensure nested key fields are marked as@shareable -
#132
ae3152cThanks @kamilkisiela! - Stop collecting paths when a leaf field was reached -
#132
ae3152cThanks @kamilkisiela! - Avoid infinite loop when entity field returns itself