graphql-python / graphql-python/graphene

call super() from resolve_<field_name> to get default resolver

Ouverte
#1,283 1 commentaire 10 réactions 0 personnes assignées Voir sur GitHub
✨ enhancement
Langage dominant
Python
Étoiles
8.2k
Forks
818
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Here is the problem, I need to create a custom resolve method but the path
for the logic to might not always require the logic added in the custom resolve method thus
I would like to use the default resolver for the field.

But I am frustrated, in the MRO hierarchy there would be no class with that exact resolve name
because the resolve method is created computationally with a call to type() in some Meta or _meta* method
like it is done in https://github.com/graphql-python/graphene-django/

Ideally I could call super().resolve(info, **args) and graphene would know how to resolve the function call

I have no idea how else to call the auto generated resolver in graphene_django, unless it would be the same name as the resolver function from which im calling super which I guess makes sense, but I believe this to be
a graphene error because the ModelObjectType inherits from ObjectType.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start by tracing the generated resolver path in graphene_django, including the type() construction and the ObjectType/ModelObjectType inheritance mentioned in the issue. Determine how a custom resolve_ could access the default resolver, and define completion as a documented, working way to invoke that default behavior without duplicating it.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
api, backend-api-design
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.