expandGenerators method
String?
expandGenerators(
- Graphql annotation, {
- required FieldElement field,
- required SharedChecker<
Model> checker,
inherited
Convert placeholders in fromGenerator
and toGenerator
to functions.
Implementation
String? expandGenerators(
_FieldAnnotation annotation, {
required FieldElement field,
required SharedChecker checker,
}) {
final name = providerNameForField(annotation.name, checker: checker);
if (doesDeserialize && annotation.fromGenerator != null) {
return digestPlaceholders(annotation.fromGenerator, name, field.name);
}
if (!doesDeserialize && annotation.toGenerator != null) {
return digestPlaceholders(annotation.toGenerator, name, field.name);
}
return null;
}