GqlBuilder constructor

GqlBuilder({
  1. List<String?>? modelFields,
  2. String? modelFragment,
  3. required String modelName,
})

Implementation

GqlBuilder({
  final List<String?>? modelFields,
  final String? modelFragment,
  required this.modelName,
}) {
  if (modelFragment != null && modelFragment.isNotEmpty) {
    returnFields = toFields(gqlFragment: modelFragment);
  } else if (modelFields != null && modelFields.isNotEmpty) {
    returnFields = modelFields.join('\n');
  } else {
    throw ArgumentError.notNull('modelFragment or modelFields');
  }
  pluralModelName = modelName.toPluralName();
}