fetchAllTypes function

List<GraphQLType?> fetchAllTypes(
  1. GraphQLSchema schema,
  2. List<GraphQLType?> specifiedTypes
)

Implementation

List<GraphQLType?> fetchAllTypes(
    GraphQLSchema schema, List<GraphQLType?> specifiedTypes) {
  var data = <GraphQLType?>{}
    ..add(schema.queryType)
    ..addAll(specifiedTypes);

  if (schema.mutationType != null) {
    data.add(schema.mutationType);
  }

  if (schema.subscriptionType != null) {
    data.add(schema.subscriptionType);
  }

  return CollectTypes(data).types.toList();
}