getClassConfig function

GraphQLObject? getClassConfig(
  1. GeneratorCtx ctx,
  2. InterfaceElement clazz
)

Implementation

GraphQLObject? getClassConfig(GeneratorCtx ctx, InterfaceElement clazz) {
  final annot = graphQLObjectTypeChecker.firstAnnotationOfExact(clazz);
  if (annot != null) {
    return GraphQLObject(
      interfaces: annot
          .getField('interfaces')!
          .toListValue()!
          .map((i) => i.toStringValue()!)
          .toList(),
      name: annot.getField('name')?.toStringValue(),
      nullableFields: annot.getField('nullableFields')?.toBoolValue() ??
          ctx.config.nullableFields,
      omitFields:
          annot.getField('omitFields')?.toBoolValue() ?? ctx.config.omitFields,
    );
  }
  return null;
}