Skip to content

Releases: graphql-hive/federation-composition

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.

v0.19.0

27 Jun 09:37
36e3501

Choose a tag to compare

Minor Changes

  • #156 46cb6bc Thanks @n1ru4l! - Support composing executable directive definitions within subgraphs into the supergraph.

v0.18.5

23 Jun 09:15
182c86f

Choose a tag to compare

Patch Changes

  • #151 f9b9908 Thanks @n1ru4l! - Fix issue where the satisfiability check raised an exception for fields that share different object type and interface definitions across subgraphs.

  • #152 e4440a1 Thanks @n1ru4l! - Fix issue where scalar type marked with @inaccessible does 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

17 Jun 11:06
f19de76

Choose a tag to compare

Patch Changes

  • #146 55b48e9 Thanks @n1ru4l! - Resolve usage of @requires FieldSet with a union field selection to raise an EXTERNAL_UNUSED error.

  • #150 9bd8016 Thanks @n1ru4l! - Fix incorrectly raised IMPLEMENTED_BY_INACCESSIBLE error 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 8c5bc0c Thanks @n1ru4l! - Add support for @provides fragment selection sets on union type fields.

    type Query {
      media: [Media] @shareable @provides(fields: "... on Book { title }")
    }
    union Media = Book | Movie

v0.18.3

13 May 15:23
fca2eb8

Choose a tag to compare

Patch Changes

  • #143 bcea968 Thanks @n1ru4l! - Do not throw an error when encountering invalid usage of @tag directive within subgraphs.

v0.18.2

13 May 10:28
dae61c1

Choose a tag to compare

Patch Changes

  • #141 fdb491f Thanks @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

01 Apr 10:22
79403f5

Choose a tag to compare

Patch Changes