UnionGenerator class

Generates sealed class hierarchies from GraphQL UNION types.

Uses __typename JSON discriminator for factory constructors.

final gen = UnionGenerator(typeMapper: mapper, schema: schema);
final code = gen.generate(schema.getType('AddItemToOrderResult') as GraphQLUnionType);

Constructors

UnionGenerator({required TypeMapper typeMapper, required GraphQLSchema schema})

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schema → GraphQLSchema
final
typeMapper → TypeMapper
final

Methods

generate(GraphQLUnionType unionType) → String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited