Packages

@theguild/federation-composition

0.27.2 · 19 Nov 2026MIT2M / weekRepositoryHomepagenpmAtom feed

Your version

0.20.0

15 Sep 2025Where it was published

0.27.2 is the newest release of 0.20.x.

In short

1 new

Release note

Minor Changes

  • 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!
    }

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.