Skip to content

Releases: graphql-hive/federation-composition

v0.22.1

17 Mar 12:04
30abe86

Choose a tag to compare

Patch Changes

  • #291 ec0ef84 Thanks @jdolle! - Support "file:" protocol and non-RFC 3986 in imported "link" url argument

  • #282 e507fdd Thanks @kamilkisiela! - Fix supergraph @join__field emission for Federation v1 @external fields and improve override/requires edge-case handling.

    • Drop Federation v1 @join__field(external: true) fields based on key usage in the subgraph instead of aggregated field key usage across subgraphs.
    • Avoid emitting redundant @join__field(external: true) metadata when a field is only required through overridden paths.
    • Tighten @join__field emission around @override and interface type fields.

v0.22.0

26 Feb 14:00
e5e1611

Choose a tag to compare

Minor Changes

  • #267 3e232fa Thanks @kamilkisiela! - Fix supergraph @join__field generation for @override + @requires migrations and add a progressive override restriction.

    When a field with @requires is overridden, composition now ignores @requires usage coming only from the overridden source field when deciding whether to keep @join__field(..., external: true). This prevents stale external annotations in the supergraph.

    Also, progressive override (@override(..., label: ...)) is now rejected when the overridden source field uses @requires (error code: OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE). Non-progressive override behavior is unchanged.

v0.21.3

16 Jan 14:28
53ad957

Choose a tag to compare

Patch Changes

  • #248 9535d50 Thanks @kamilkisiela! - Fix access validation on union members when selecting __typename in @requires directives.

    The @requires directive validation rule (AuthOnRequiresRule) was not checking authorization requirements for __typename selections on and types. When __typename on a union type was selected, code would throw an unexpected error.

v0.21.2

12 Jan 14:16
8984caa

Choose a tag to compare

Patch Changes

  • #241 c6e26ed Thanks @kamilkisiela! - Fixes a bug in @key directive validation where an error was incorrectly reported for interfaces implementing another interface with a @key. The validation now correctly applies only to object types implementing the interface.

v0.21.1

10 Dec 12:54
97660f8

Choose a tag to compare

Patch Changes

  • #230 2b34f17 Thanks @n1ru4l! - Prevent subgraph-specific federation types and scalars being re-declared within the subgraph leaking into the supergraph.

v0.21.0

24 Nov 12:31
f7e7097

Choose a tag to compare

Minor Changes

  • #215 5edf421 Thanks @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 @requires specifies at least the auth requirements of the fields it selects. If a field doesn't carry forward the @authenticated, @requiresScopes or @policy requirements of its dependencies, composition fails with a MISSING_TRANSITIVE_AUTH_REQUIREMENTS error.

    Propagate auth requirements through interface hierarchies. Interface types and fields now inherit @authenticated, @requiresScopes and @policy from the object types that implement them.

  • #215 5edf421 Thanks @kamilkisiela! - Disallowed using @cost on interfaces - you can no longer place @cost on an interface type, its fields, or field arguments. Composition now fails with a clear error instead of accepting it silently.

    The @listSize directive now validates that sizedFields point to list fields, not integer counters (e.g., use edges instead of count).

    Added validation for slicingArguments in @listSize. Only arguments that exist in all subgraphs are kept, invalid ones trigger an error.

Patch Changes

  • #215 5edf421 Thanks @kamilkisiela! - The EXTERNAL_MISSING_ON_BASE rule has been updated to handle @interfaceObject corner‑cases, like @external fields on object types, but provided by interface objects, were triggering false positives.

v0.20.2

22 Oct 15:58
afda209

Choose a tag to compare

Patch Changes

  • #198 1b98c17 Thanks @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

19 Sep 09:37
0e52429

Choose a tag to compare

Patch Changes

v0.20.0

15 Sep 07:53
8593e38

Choose a tag to compare

Minor Changes

  • #180 a208f1c Thanks @n1ru4l! - Add composeSchemaContract function 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

30 Jun 07:34
3c993be

Choose a tag to compare

Patch Changes

  • #149 9ae49e3 Thanks @n1ru4l! - Fix external key fields on extended object types raising composition errors.