def METHOD_NAME(
    self, type: GraphQLType, parent_type: Optional[GraphQLType] = None
) -> str:
    if isinstance(type, GraphQLOptional):
        return self.METHOD_NAME(type.of_type, type)
    if isinstance(type, GraphQLList):
        type_name = f"[{self.METHOD_NAME(type.of_type, type)}]"
    else:
        type_name = type.name
    if parent_type and isinstance(parent_type, GraphQLOptional):
        return type_name
    return f"{type_name}!"