root Field Ref
abstract fun <A : Arguments, BR : Object> rootFieldRef(field: RootObjectField<*, BR, A>, arguments: A): BR(source)
Creates a lazy reference to a root field that will be later resolved by the engine. field must be either a field on the root query type, or a field reachable from the root query type through @namespaceType-typed fields. It must also have an object type.
No fields are accessible from the returned value. Attempting to access fields will result in an exception. The returned value may be used as a resolver return value or passed to a GRT builder.
Example usage:
val product = ctx.rootFieldRef(ProductFactory.Fields.create, args)Content copied to clipboard