def METHOD_NAME(obj, info, slug):
    qs = ProjectModel.objects.visible_for(info.context.user)
    fields = get_fields(info)
    if "project.localizations" in fields:
        qs = qs.prefetch_related("project_locale__locale")
    if "project.tags" in fields:
        qs = qs.prefetch_related("tag_set")
    if "project.localizations.locale.localizations" in fields:
        raise Exception("Cyclic queries are forbidden")
    return qs.get(slug=slug)