backingData Directive
Specify backing data classes for fields to separate transformation logic from retrieval.
Custom directives in Viaduct enhance your GraphQL schema with extra behavior and validation. This page introduces the directives used in the Star Wars demo and links to focused pages for details and examples.
@backingData — bind a field to a backing data class for transformation logic.@scope — expose types/fields only to specific scopes (multi-module boundaries).@idOf — mark ID fields/args with their GraphQL type for type-safe Global ID handling.@oneOf — enforce exactly one non-null field in an input object (union-like inputs).To access scoped fields, include the
X-Viaduct-Scopesheader in your request.
Specify backing data classes for fields to separate transformation logic from retrieval.
Control schema visibility and multi-module access with @scope; Star Wars demo uses an app-level header.
Bind ID fields to GraphQL types for type-safe Global ID handling in Viaduct.
Ensure exactly one non-null field in input objects; works well with @idOf for typed Global IDs.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.