SchemaSync class

Compares the schema with the generated files under GraphQLGenConfig.output and plans the changes that bring them in line.

Without regenerate, an existing model is rewritten only when its constructor parameters differ from the schema, so hand edits that keep the same fields survive, and enum files are rewritten only when their values change. With regenerate, every generated file is rewritten and everything else under the managed directories is deleted, except paths matching preserve.

Constructors

SchemaSync(GraphQLGenConfig config, GqlSchema schema, {String root = '.', bool regenerate = false})

Properties

config → GraphQLGenConfig
final
hashCode → int
The hash code for this object.
no setterinherited
layout → Layout
final
models ↔ ModelTemplate
latefinal
regenerate → bool
final
root → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schema → GqlSchema
final
singles ↔ SingleFileTemplates
latefinal
types → TypeMapper
final

Methods

apply(SyncResult result) → void
Writes result to disk.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
plan() → SyncResult
Computes the changes without touching the file system.
toString() → String
A string representation of this object.
inherited

Operators

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