fromNode static method

Implementation

static ExecutableDefinition fromNode(ExecutableDefinitionNode astNode,
    [GetExecutableType? getType]) {
  if (astNode is OperationDefinitionNode) {
    return OperationDefinition(astNode, getType);
  }
  if (astNode is FragmentDefinitionNode) {
    return FragmentDefinition(astNode, getType);
  }

  throw ArgumentError("$astNode is unsupported");
}