Releases: graphql-hive/federation-composition
v0.21.0
Minor Changes
-
#215
5edf421Thanks @kamilkisiela! - Enforce correct placement of auth directives. A new validation rule (AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE) rejects any attempt to put these directives on interfaces, interface fields or interface objects.Add transitive-auth requirements checking. A new rule verifies that any field using
@requiresspecifies at least the auth requirements of the fields it selects. If a field doesn't carry forward the@authenticated,@requiresScopesor@policyrequirements of its dependencies, composition fails with aMISSING_TRANSITIVE_AUTH_REQUIREMENTSerror.Propagate auth requirements through interface hierarchies. Interface types and fields now inherit
@authenticated,@requiresScopesand@policyfrom the object types that implement them. -
#215
5edf421Thanks @kamilkisiela! - Disallowed using@coston interfaces - you can no longer place@coston an interface type, its fields, or field arguments. Composition now fails with a clear error instead of accepting it silently.The
@listSizedirective now validates thatsizedFieldspoint to list fields, not integer counters (e.g., useedgesinstead ofcount).Added validation for
slicingArgumentsin@listSize. Only arguments that exist in all subgraphs are kept, invalid ones trigger an error.
Patch Changes
- #215
5edf421Thanks @kamilkisiela! - TheEXTERNAL_MISSING_ON_BASErule has been updated to handle@interfaceObjectcorner‑cases, like@externalfields on object types, but provided by interface objects, were triggering false positives.
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 }