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

Does this package support union type fragments?

Đang mở
#30 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ệ
python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với gql/query_parser.py, đặc biệt là parse và phần xử lý selection-set được hiển thị trong traceback; kiểm tra cách gql run trong gql/cli.py truyền document cho parser. Tái hiện query được cung cấp, sau đó xác minh rằng các fragment của kiểu union được parse mà không gặp IndexError.

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

Mô tả

I have a .graphql file that looks like this:

query GetBook($id: UUID!) {
  book(id: $id) {
    author {
      id
      name
      ... on FantasyAuthor {
        fantasyBooksWritten
      }
      ... on SciFiAuthor {
        sciFiBooksWritten
      }
    }
  }
}

However, when I run gql run I get the following error:

Parsing /home/user/python-test/book_query.graphql ... Traceback (most recent call last):
  File "/home/user/.local/bin/gql", line 11, in <module>
    sys.exit(cli())
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/gql/cli.py", line 99, in run
    process_file(filename, query_parser, query_renderer)
  File "/home/user/.local/lib/python3.8/site-packages/gql/cli.py", line 68, in process_file
    parsed = parser.parse(query)
  File "/home/user/.local/lib/python3.8/site-packages/gql/query_parser.py", line 243, in parse
    visit(document_ast, TypeInfoVisitor(type_info, visitor))
  File "/home/user/.local/lib/python3.8/site-packages/graphql/language/visitor.py", line 286, in visit
    result = visit_fn(visitor, node, key, parent, path, ancestors)
  File "/home/user/.local/lib/python3.8/site-packages/graphql/language/visitor.py", line 394, in leave
    result = fn(self.visitor, node, *args) if fn else None
  File "/home/user/.local/lib/python3.8/site-packages/gql/query_parser.py", line 109, in leave_selection_set
    self.pull()
  File "/home/user/.local/lib/python3.8/site-packages/gql/query_parser.py", line 70, in pull
    return self.dfs_path.pop()
IndexError: pop from empty list

wondering if anyone has seen similar issues. Thanks!

Ngôn ngữ chính
Python
Star
78
Fork
6
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/gql-next

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

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.