Federation Subgraph Transform
GraphQL Mesh v0 documentation (superseded by v1): Conform to the federation specification with GraphQL Mesh federation transform. Reuse source code for compliance and use complex business logic with code file resolvers.
This transform allows to create subgraphs from your regular sources which don’t have any federation
annotations. This transform uses
graphql-transform-federation package.
How to use?
Add the following configuration to your Mesh config file:
Add Reference Resolver as a Code File
To add more complex business logic, you can point to a code file that exports a resolver function.
types(type:Array of Object, required):name(type:String, required)config(type:Object):key(type:Array of Object):fields(type:String)
shareable(type:Boolean)extends(type:Boolean)fields(type:Array of Object, required):name(type:String, required)config(type:Object, required):external(type:Boolean)provides(type:Object):fields(type:String)
requires(type:Object):fields(type:String)
tag(type:Object):name(type:String)
inaccessible(type:Boolean)override(type:Object):from(type:String)
resolveReference- One of:Stringobject:queryFieldName(type:String, required) - Name of root field name that resolves the referenceargs(type:JSON) - You need configure the arguments for that field;
args:
someArg: "{root.someKeyValue}"
version(type:String) - Version of the federation spec Default: v2.0