Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#29 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
flask, graphql, python
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu với schema lồng nhau Query.animals và ví dụ resolve_animals của nó, sau đó tái hiện lỗi qua GraphiQL 0.7.1 trong khi kiểm tra response introspection. So sánh trường hợp NonNull/list lồng nhau với các phiên bản loại bỏ NonNull; được xem là hoàn tất khi schema có thể được introspect và GraphiQL không còn báo lỗi decorated-type.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
Python
Star
1.3k
Fork
139
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphql-python/flask-graphql

Tất cả issue của graphql-python/flask-graphql

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.