in src/main/com/intellij/lang/jsgraphql/types/schema/idl/SchemaPrinter.java [1125:1171]
private String getDescription(Object descriptionHolder) {
if (descriptionHolder instanceof GraphQLObjectType type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(ObjectTypeDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLEnumType type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(EnumTypeDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLFieldDefinition type) {
return description(type.getDescription(), ofNullable(type.getDefinition()).map(FieldDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLEnumValueDefinition type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(EnumValueDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLUnionType type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(UnionTypeDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLInputObjectType type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(InputObjectTypeDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLInputObjectField type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(InputValueDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLInterfaceType type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(InterfaceTypeDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLScalarType type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(ScalarTypeDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLArgument type) {
return description(type.getDescription(),
ofNullable(type.getDefinition()).map(InputValueDefinition::getDescription).orElse(null));
}
else if (descriptionHolder instanceof GraphQLDirective type) {
return description(type.getDescription(), null);
}
else {
return Assert.assertShouldNeverHappen();
}
}