On this page

@graphql-mesh/fusion-composition

Changelog for @graphql-mesh/fusion-composition: every release with its changes and the pull requests behind them.

0.11.2

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.107.1

0.11.1

Patch Changes

  • #9635 c47a0c0 Thanks @ardatan! - Preserve interface implementors and union members when encapsulating a subgraph, keep original field directives on wrapped fields, and nest a second encapsulate (same outer name across subgraphs) without dropping inner namespaces.

0.11.0

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.107.0

0.10.0

Minor Changes

  • #6007 0f4ec4a Thanks @SGudbrandsson! - Add optional force to prefix protected custom scalars (e.g. from graphql-scalars) that are ignored by default. GraphQL-specified scalars stay unprefixed.

    Note: v1 createPrefixTransform previously prefixed those protected scalars by default; that was a bug. Aligning with the legacy ignore behavior is a bug fix (not a breaking change). Use force to opt in.

Patch Changes

  • #9609 07c7b8e Thanks @ardatan! - Batched @resolveTo joins can now match results to keys by a field on each result (valueKeyField), instead of assuming the upstream returns one row per key in request order. Use this for collection-style sources (Strapi filters, Hasura where, SQL IN (...), and similar) that return rows in their own order, skip missing keys, or return multiple rows per key.

    Example:

    extend type SearchResult {
      products: [Product!]!
        @resolveTo(
          sourceName: "Products"
          sourceTypeName: "Query"
          sourceFieldName: "productsBySkus"
          keyField: "sku"
          keysArg: "skus"
          valueKeyField: "sku"
        )
    }

    Docs: Schema Extensions → Matching results by a field (valueKeyField)

  • Updated dependencies [a7cbeef, e148b13, 07c7b8e]:

    • @graphql-mesh/utils@0.106.0

0.9.2

Patch Changes

  • #9603 f2f715f Thanks @enisdenjo! - Hide types that become unreachable when createFilterTransform filters their last accessible field

    The filter transform keeps filtered fields in the executable subgraph schema and marks them with @inaccessible. This is necessary because their definitions can still carry execution metadata, but it also means that a later prune transform considers their referenced types reachable. Those types were consequently left in the public API schema, including generated unions whose operations had all been filtered.

    The transform now compares schema reachability before and after applying its filters. Types that were reachable before filtering but are unreachable afterward are marked with @inaccessible, allowing composition to omit them from the public API while retaining them in the supergraph for execution. Types that were already unreachable before filtering and root operation types are preserved to avoid changing existing filtering behavior. Enum types are also preserved because federation validates enum values used in argument defaults before removing inaccessible fields from the API schema.

0.9.1

Patch Changes

0.9.0

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.105.0

0.8.50

Patch Changes

0.8.49

Patch Changes

0.8.48

Patch Changes

  • #9454 9e23b1f Thanks @ardatan! - Do not mark root types inaccessible solely because all of their fields were filtered out. Previously, filtering all Mutation fields also made the Mutation type inaccessible, which was unintended. Now, root types are only marked inaccessible when explicitly marked as such. If all Mutation fields are filtered, the Mutation type remains accessible while those fields are marked inaccessible.

0.8.47

Patch Changes

0.8.46

Patch Changes

0.8.45

Patch Changes

0.8.44

Patch Changes

  • d745894 Thanks @ardatan! - Copy the implementation instead of importing it from graphql-js

0.8.43

Patch Changes

  • #9398 bc4b5d0 Thanks @ardatan! - Add validation for transforms such as Federation Transform to provide better error messages when the configuration is incorrect. This includes suggestions for field names and argument names when they are not found in the schema. Additionally, improve error messages when applying transforms to subgraphs.

    This also adds validation for @merge and @resolveTo directives to ensure that the referenced fields and arguments exist in the subgraph schemas, providing suggestions when they do not.

0.8.42

Patch Changes

0.8.41

Patch Changes

0.8.40

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.32

0.8.39

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.31

0.8.38

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.30

0.8.37

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.29

0.8.36

Patch Changes

0.8.35

Patch Changes

0.8.34

Patch Changes

0.8.33

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.26

0.8.32

Patch Changes

  • #9278 04df502 Thanks @ardatan! - If the encapsulated fields are conflicting, they will be renamed to include the subgraph name as a prefix and the renamed fields will be marked with the @inaccessible directive. For example, if both Subgraph A and Subgraph B have a getItems field, they will be renamed to _encapsulated_SubgraphA_getItems and _encapsulated_SubgraphB_getItems respectively, and the original getItems fields will be removed from the root type to prevent conflicts.

    Subgraph A

    type Query {
      getItems: [SubgraphA_Item]
    }
    
    type SubgraphA_Item {
      id: ID
    }

    Subgraph B

    type Query {
      getItems: [SubgraphB_Item]
    }
    
    type SubgraphB_Item {
      id: ID
    }
  • Updated dependencies []:

    • @graphql-mesh/utils@0.104.25

0.8.31

Patch Changes

0.8.30

Patch Changes

0.8.29

Patch Changes

0.8.28

Patch Changes

0.8.27

Patch Changes

0.8.26

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.21

0.8.25

Patch Changes

0.8.24

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.19

0.8.23

Patch Changes

0.8.22

Patch Changes

0.8.21

Patch Changes

  • Updated dependencies [3987b80]:
    • @graphql-mesh/utils@0.104.17

0.8.20

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.16

0.8.19

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.15

0.8.18

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.14

0.8.17

Patch Changes

0.8.16

Patch Changes

  • 8c1456d Thanks @ardatan! - Fix issues with missing query type and extends modifier

  • Updated dependencies [ffec6e7]:

    • @graphql-mesh/utils@0.104.12

0.8.15

Patch Changes

  • Updated dependencies [d61faf0]:
    • @graphql-mesh/utils@0.104.11

0.8.14

Patch Changes

  • Updated dependencies [7852ccd, 7852ccd]:
    • @graphql-mesh/utils@0.104.10

0.8.13

Patch Changes

  • Updated dependencies [0c18fe1]:
    • @graphql-mesh/utils@0.104.9

0.8.12

Patch Changes

  • #8710 76df3d1 Thanks @ardatan! - Use the latest compatible federation version v2.6 not v2.3 when upgrading the existing import

  • Updated dependencies [fb6e935]:

    • @graphql-mesh/utils@0.104.8

0.8.11

Patch Changes

0.8.10

Patch Changes

  • Updated dependencies [e2666bc]:
    • @graphql-mesh/utils@0.104.6

0.8.9

Patch Changes

  • Updated dependencies [9d61d75]:
    • @graphql-mesh/utils@0.104.5

0.8.8

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.104.4

0.8.7

Patch Changes

0.8.6

Patch Changes

  • Updated dependencies [0af3d0c, 0af3d0c]:
    • @graphql-mesh/utils@0.104.3

0.8.5

Patch Changes

0.8.4

Patch Changes

0.8.3

Patch Changes

0.8.2

Patch Changes

  • Updated dependencies [1b5d072]:
    • @graphql-mesh/utils@0.104.2

0.8.1

Patch Changes

  • Updated dependencies [b6c083c, f416982]:
    • @graphql-mesh/utils@0.104.1

0.8.0

Patch Changes

  • Updated dependencies [4528794, 4528794]:
    • @graphql-mesh/utils@0.104.0

0.7.27

Patch Changes

  • Updated dependencies [903124f]:
    • @graphql-mesh/utils@0.103.21

0.7.26

Patch Changes

  • Updated dependencies [3f5e0a1]:
    • @graphql-mesh/utils@0.103.20

0.7.25

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.103.19

0.7.24

Patch Changes

  • Updated dependencies [ab0863b]:
    • @graphql-mesh/utils@0.103.18

0.7.23

Patch Changes

  • Updated dependencies [eee582a]:
    • @graphql-mesh/utils@0.103.17

0.7.22

Patch Changes

  • Updated dependencies [b44f8b7]:
    • @graphql-mesh/utils@0.103.16

0.7.21

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.103.15

0.7.20

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.103.14

0.7.19

Patch Changes

0.7.18

Patch Changes

  • #8268 f1b5e8e Thanks @ardatan! - Respect other @composeDirective definitions other than Mesh

  • Updated dependencies [5180b06]:

    • @graphql-mesh/utils@0.103.12

0.7.17

Patch Changes

  • Updated dependencies [4011203]:
    • @graphql-mesh/utils@0.103.11

0.7.16

Patch Changes

  • Updated dependencies [b750a41]:
    • @graphql-mesh/utils@0.103.10

0.7.15

Patch Changes

  • Updated dependencies [10ba2c4]:
    • @graphql-mesh/utils@0.103.9

0.7.14

Patch Changes

  • Updated dependencies [93fb364]:
    • @graphql-mesh/utils@0.103.8

0.7.13

Patch Changes

  • #7961 1a7adbf Thanks @ardatan! - HATEOAS Support

  • Updated dependencies []:

    • @graphql-mesh/utils@0.103.7

0.7.12

Patch Changes

  • Updated dependencies [2ef651a]:
    • @graphql-mesh/utils@0.103.6

0.7.11

Patch Changes

  • 5883d66 Thanks @ardatan! - Respect existing federation directives when federation transform is used

0.7.10

Patch Changes

  • 6a4d978 Thanks @ardatan! - Add federation annotations correctly to the root fields

0.7.9

Patch Changes

0.7.8

Patch Changes

0.7.7

Patch Changes

  • 750ce54 Thanks @ardatan! - Respect resolveTo directives in rename transform

  • Updated dependencies [9f9f6fe]:

    • @graphql-mesh/utils@0.103.5

0.7.6

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.103.4

0.7.5

Patch Changes

  • Updated dependencies [6360755]:
    • @graphql-mesh/utils@0.103.3

0.7.4

Patch Changes

  • Updated dependencies [bfd8929]:
    • @graphql-mesh/utils@0.103.2

0.7.3

Patch Changes

  • #7993 8154187 Thanks @ardatan! - Do not apply semantic conventions if there is already defined some federation annotations

0.7.2

Patch Changes

0.7.1

Patch Changes

0.7.0

Patch Changes

  • Updated dependencies [0e49907, 9873b33]:
    • @graphql-mesh/utils@0.103.0

0.6.7

Patch Changes

  • #7936 4236099 Thanks @ardatan! - Do not create extra `@transport` annotation if the subgraph is a regular HTTP subgraph

  • Updated dependencies []:

    • @graphql-mesh/utils@0.102.13

0.6.6

Patch Changes

  • Updated dependencies [eee53b9]:
    • @graphql-mesh/utils@0.102.12

0.6.5

Patch Changes

0.6.4

Patch Changes

0.6.3

Patch Changes

  • #7816 fad4d27 Thanks @ardatan! - Fix subscription fields fed by webhooks and defined in `additionalTypeDefs` with `@resolveTo`

  • Updated dependencies [fad4d27]:

    • @graphql-mesh/utils@0.102.9

0.6.2

Patch Changes

0.6.1

Patch Changes

0.6.0

Minor Changes

Patch Changes

0.5.4

Patch Changes

  • Updated dependencies [bf588d3]:
    • @graphql-mesh/utils@0.102.6

0.5.3

Patch Changes

  • #7722 e9483d6 Thanks @ardatan! - Do not add another @hidden directive definition if it already exists

0.5.2

Patch Changes

  • #7676 adc3293 Thanks @ardatan! - If the target hoisted field is a new field name that doesn’t exist, create that field and keep the existing one;

    createHoistFieldTransform({
      mapping: [
        {
          typeName: 'Query',
          pathConfig: ['users', 'results'],
          newFieldName: 'usersResults'
        }
      ]
    })
    type Query {
      users(limit: Int!, page: Int): UserSearchResult # Keep this
    + usersResults(limit: Int!, page: Int): [User!]! # Add a new one
    }
    
    scalar _HoistConfig
    
    type UserSearchResult {
      page: Int!
    }
    
    type User {
      id: ID!
      name: String!
    }

0.5.1

Patch Changes

  • 28cd8b0 Thanks @ardatan! - Automatically upgrade Federation v2.0 to v2.x because Mesh Compose doesn’t support v2.0 and it needs `@composeDirective` which is available since v2.1

0.5.0

Minor Changes

  • #7580 75e9f63 Thanks @ardatan! - BREAKING: All types prefixed with MeshServe, now are prefixed with Gateway. e.g. MeshServeRuntime -> GatewayRuntime

    Runtime factory is renamed; createServeRuntime -> createGatewayRuntime

    The expected export name for config files are renamed from serveConfig to gatewayConfig

    RENAMING:

    You can rename the product, config file name etc by using the following config options;

    For example;

    productName = 'Mesh Gateway'
    productDescription =
      'Mesh Gateway is a GraphQL Gateway that can be used to serve a supergraph schema.'
    productLogo = '<svg>...</svg>'
    productPackageName = '@graphql-mesh/gateway'

Patch Changes

0.4.5

Patch Changes

0.4.4

Patch Changes

  • Updated dependencies [edbc074]:
    • @graphql-mesh/utils@0.102.4

0.4.3

Patch Changes

  • Updated dependencies [14ec31f]:
    • @graphql-mesh/utils@0.102.3

0.4.2

Patch Changes

  • Updated dependencies [5d95aad]:
    • @graphql-mesh/utils@0.102.2

0.4.1

Patch Changes

  • #7550 102d970 Thanks @ardatan! - New Transport and Loader implementation for OData

  • Updated dependencies [e49a7e6]:

    • @graphql-mesh/utils@0.102.1

0.4.0

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.102.0

0.3.0

Patch Changes

0.2.0

Patch Changes

0.1.9

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/utils@0.99.7

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

  • Updated dependencies [33c23e8]:
    • @graphql-mesh/utils@0.99.5

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

  • Updated dependencies [4bc495c]:
    • @graphql-mesh/utils@0.99.2

0.1.1

Patch Changes

0.1.0

Patch Changes

0.0.8

Patch Changes

0.0.7

Patch Changes

  • #7145 7544594 Thanks @ardatan! - dependencies updates:

  • #7145 7544594 Thanks @Author, @User! - New Federation Composition Approach for the new Mesh v1 alpha; (If you are using Mesh v0 legacy, ignore this changelog)

    Now Mesh Compose produces a superset of Federated Supergraph.

    • Drop any options and implementation related to the old fusiongraph
      • The output is a valid supergraph that can be consumed by any Federation router. But if it is not Mesh Serve, the subgraph should still be served via Mesh Serve then consumed by that Federation router. If it is Mesh Serve, no additional server is needed because Mesh Serve already knows the additional directives etc of the transports
    • Compose the subgraphs using @theguild/federation-composition package
      • So benefit from the validation rules of Federation in Mesh Compose
    • Ability to consume existing federated subgraphs
      • Since the composition is now Federation, we can accept any federated subgraph
    • Implement Federation transform to transform any subgraph to a federated subgraph by adding Federation directives (v2 only) . This is on user’s own because they add the directives manually. And for __resolveReference, we use @merge directive to mark a root field as an entity resolver for Federation
    • Use additional @source directive to consume transforms on the subgraph execution (field renames etc)
    • Use additional @resolveTo directive to consume additional stitched resolvers
    • Use additional @transport directive to choose and configure a specific transport for subgraphs
    • Handle unsupported additional directives with another set of additional directives on Query for example directives on unions, schema definitions, enum values etc and then @extraUnionDirective added with missing directives for unions then on the runtime these directives are added back to the union for the subgraph execution of the transports.

    Basically Mesh Compose uses Federation spec for composition, validation and runtime BUT the output is a superset with these additional directives imported via @composeDirective;

    • @merge (Taken from Stitching Directives) If a custom entity resolver is defined for a root field like below, the gateway will pick it up as an entity resolver;
    type Query {
       fooById(id: ID!): Foo @merge(keyField: 'id', keyArg: 'id', subgraph: Foo)
    }
    • @resolveTo (Taken from v0) This allows to delegate to a field in any subgraph just like Schema Extensions in old Schema Stitching approach;
        extend type Book {
    
            @resolveTo(
              sourceName: "authors"
              sourceTypeName: "Query"
              sourceFieldName: "authors"
              keyField: "authorId"
              keysArg: "ids"
            )
        }
    • @source Taken from Fusion This allows us to know how the original definition is in the subgraph. If this directive exists, the runtime applies the transforms from Schema Stitching during the subgraph execution. This directive can exist in arguments, fields, types etc.
    type Query {
     @source(type: "MyUser") # This means `User` is actually `MyUser` in the actual subgraph
    }
    
    type User @source(name: "MyUser") {
      id: ID
      name: String
    }
    • @transport Taken from Fusion This allows us to choose a specific transport (rest, mysql, graphql-ws, graphql-http etc) for the subgraph execution with some configuration. In the runtime, the gateway loads the transports and passes the subgraph schema with annotations if needed to get an executor to execute queries against that subgraph.
    schema @transport(subgraph: "API", kind: "rest", location: "http://0.0.0.0:<api_port>") {
      query: Query
      mutation: Mutation
      subscription: Subscription
    }
    • @extraSchemaDefinitionDirective By default, it is not possible to add directives from subgraph to the supergraph but it is possible to do the same thing on types or fields. So we add this directive to Query for the directives we want to add to the schema. Then the runtime picks those per subgraph to put the directives back to their original places;
    type Query @extraSchemaDefinitionDirective(
      directives: {transport: [{subgraph: "petstore", kind: "rest", location: "http://0.0.0.0:<petstore_port>/api/v3"}]}
    )  {
    • @extraEnumValueDirective and @extraTypeDirective Same for enum values and unions etc that are not supported by the composition library

    Thanks to these directives, subgraphs can be published individually to Hive for example then the supergraph stored there can be handled by Mesh Gateway since the composition is the same. All the additions etc are done on the subgraph level. For the Fed gateways except Mesh Serve, subgraphs can be served individually by Mesh Serve again while they are consumed by any gw like Apollo Router Shareable is enabled by default for non-federated subgraphs

    Documentation PR has details for users; https://github.com/ardatan/graphql-mesh/pull/7109

  • Updated dependencies [f985978, 7544594]:

    • @graphql-mesh/utils@0.98.9

0.0.6

Patch Changes

0.0.5

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes

0.0.1

Patch Changes