fromNode static method

GraphQLType fromNode(
  1. TypeNode astNode, [
  2. ResolveType? getType
])

Implementation

static GraphQLType fromNode(
  TypeNode astNode, [
  ResolveType? getType,
]) {
  if (astNode is NamedTypeNode) {
    return NamedType(astNode, getType);
  }
  if (astNode is ListTypeNode) {
    return ListType(astNode, getType);
  }
  throw ArgumentError("$astNode is unsupported");
}