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

"Decorated type deeper than introspection query" error with nested lists

Aperta
#29 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia con lo schema annidato Query.animals e il relativo esempio resolve_animals, quindi riproduci il fallimento tramite GraphiQL 0.7.1 mentre esamini la risposta di introspezione. Confronta il caso annidato NonNull/list con le versioni che rimuovono NonNull; il lavoro è completo quando lo schema può essere sottoposto a introspezione e GraphiQL non segnala più l’errore decorated-type.

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

Descrizione

We see the following errors when using nested lists:

Error: Decorated type deeper than introspection query.
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23637)
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23879)
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23733)
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23879)
    at r (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:24425)
    at http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:26609
    at http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:11:8480
    at Array.reduce (native)
    at keyValMap (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:11:8444)
    at f (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:26484)

Here's the example code that can cause this issue. Graphene introspection doesn't report any errors.

import graphene, json

class Animal(graphene.Interface):
   id = graphene.String()

class Dog(graphene.ObjectType):
   class Meta:
      interfaces = (Animal, )
   breed = graphene.String()

class Cat(graphene.ObjectType):
   class Meta:
      interfaces = (Animal, )
   category = graphene.String()

class Query(graphene.ObjectType):
  animals = graphene.NonNull(graphene.List(graphene.NonNull(graphene.List(graphene.NonNull(Animal)))))
  def resolve_animals(self, args, context, info):
    return[[Dog(id=1, breed='Golden Retriever'),
            Dog(id=2, breed='German Shepard')],
           [Cat(id=11, category ='Tiger'),
            Cat(id=12, category='House Cat')]]

schema = graphene.Schema(query=Query, types=[Dog, Cat, ])

Errors disappear if we remove the "required" or NonNull decorators. Any suggestions on how to fix these errors?

Lingua principale
Python
Stelle
1.3k
Fork
139
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/flask-graphql

Tutte le issue di graphql-python/flask-graphql

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.