Does this package support union type fragments?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with gql/query_parser.py, especially parse and the selection-set handling shown in the traceback; inspect how gql run in gql/cli.py passes the document to the parser. Reproduce the supplied query, then verify that union type fragments parse without the IndexError.
Written by the indexing model from the issue text.
Description
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!
- Dominant language
- Python
- Stars
- 78
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from graphql-python/gql-next
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
graphql-python/gql-next#29 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
graphql-python/gql-next#28 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
graphql-python/gql-next#27 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
graphql-python/gql-next#25 · 3 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
graphql-python/gql-next#22 · 1 comment ·
All issues in graphql-python/gql-next
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/skills#1811 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
datalayer/mcp-compose#42 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
UKGovernmentBEIS/inspect_evals#2523 ·