private static T checkNode()

in src/main/com/intellij/lang/jsgraphql/schema/GraphQLPsiDocumentBuilder.java [809:844]


  private static <T extends Node> T checkNode(@Nullable T node) {
    if (node == null) return null;
    if (node instanceof NamedNode) {
      String name = ((NamedNode<?>)node).getName();
      if (StringUtil.isEmpty(name)) return null;
    }
    if (node instanceof ListType) {
      Type type = ((ListType)node).getType();
      if (type == null) return null;
    }
    if (node instanceof NonNullType) {
      Type type = ((NonNullType)node).getType();
      if (type == null) return null;
    }
    if (node instanceof OperationTypeDefinition) {
      TypeName typeName = ((OperationTypeDefinition)node).getTypeName();
      if (typeName == null) return null;
    }
    if (node instanceof VariableDefinition) {
      Type type = ((VariableDefinition)node).getType();
      if (type == null) return null;
    }
    if (node instanceof FragmentDefinition) {
      TypeName typeCondition = ((FragmentDefinition)node).getTypeCondition();
      if (typeCondition == null) return null;
    }
    if (node instanceof FieldDefinition) {
      Type type = ((FieldDefinition)node).getType();
      if (type == null) return null;
    }
    if (node instanceof InputValueDefinition) {
      Type type = ((InputValueDefinition)node).getType();
      if (type == null) return null;
    }
    return node;
  }