Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

In 3.1.0, `resolve_type` method on Interfaces and Unions no longer supports returning the GraphQL Type as a string

Aperta
#1,555 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Inizia esaminando la gestione di resolve_type modificata nella regressione della versione 3.1.0 descritta qui e confrontala con la modifica proposta nella pull request del fork collegato. Aggiungi un unit test che copra un risultato di tipo GraphQL stringa, quindi esegui la suite di test pertinente e conferma che il comportamento funzioni senza interrompere i risultati di Graphene Type.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🐛 bug
  • What is the current behavior?
    As of 3.1.0, the resolve_type method on Interfaces and Unions no longer supports returning the GraphQL Type as a string as opposed to the actual Graphene Type. I think this might be an unintended regression from https://github.com/graphql-python/graphene/pull/1421.

  • What is the expected behavior?
    Our project heavily depends on resolve_type returning a string for the GraphQL Type as opposed to the Graphene Type that implements it.

  • What is the motivation / use case for changing the behavior?
    While it's possible to refactor most of our code to return the Graphene Type, there are some cases where it's very difficult to break circular imports. The reason for that is that some of our implementations of the resolve_type method delegates to returning a property of an Enum and the Enum definition can't reference the Graphene Type because the Graphene Type references the enum.

  • Please tell us about your environment:

    • Version: Trying to upgrade to 3.1.0.
    • Platform: Python 3.12.2 on Linux
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
    I created https://github.com/perlow/graphene/pull/1 in a fork. I don't have write permission the repo to request a merge. If this looks reasonable, I can add a unit test for the behavior.

Lingua principale
Python
Stelle
8.2k
Fork
818
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di graphql-python/graphene

Tutte le issue di graphql-python/graphene

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.