generateProperties static method

List<ClassProperty> generateProperties({
  1. required List<FieldDefinitionNode> fields,
  2. required Context context,
  3. required void onNewClassFound(
    1. Context
    ),
})

Generate properties for a class from GraphQL field definitions

Implementation

static List<ClassProperty> generateProperties({
  required List<FieldDefinitionNode> fields,
  required Context context,
  required void Function(Context) onNewClassFound,
}) {
  final properties = <ClassProperty>[];

  for (final field in fields) {
    final property = _generateProperty(
      field: field,
      context: context,
      onNewClassFound: onNewClassFound,
    );
    properties.add(property);
  }

  return properties;
}