Hoist Field Transform
GraphQL Mesh v0 documentation (superseded by v1): Learn how to use the hoist transform from GraphQL Mesh to lift a field from one object type to a 'parent' root or object type. Explore the HoistField transform and more.
The hoist transform allows you to lift a field from one object type to a ‘parent’ root or object
type. It is currently only available as a wrap transform.
How to use?
Given the following schema:
Simple hoisting
Will transform the given schema to:
Filtering args via a default for the entire path
Will transform the given schema to:
Filtering args on specific levels of the path
Will transform the given schema to:
Config API Reference
typeName(type:String, required) - Type name that defines where field should be hoisted topathConfig- - Array of fieldsNames to reach the field to be hoisted (required) Array of:Stringobject:fieldName(type:String, required) - Field namefilterArgs(type:Array of String, required) - Match fields based on argument, needs to implement(arg: GraphQLArgument) => boolean;
newFieldName(type:String, required) - Name the hoisted field should have when hoisted to the type specified in typeNamealias(type:String)filterArgsInPath(type:Boolean) - Defines if args in path are filtered (default = false)