-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Pydantic model definition errors for fragments with nesting #253
Comments
Hey, I managed to reproduce both of these issues:
I will create a separate issue with a more accurate description for the 1. issue and let's keep the current one for 2. |
This was referenced Dec 18, 2023
I am sorry, so is there a solution for this issue? Edit: whoops, I am sorry, used 0.11 instead of 0.13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Pydantic types are incorrectly defined when fragments contain nested nodes.
Example:
There are two issues in the last case.
IssueFieldsAuthor
type includes a required__typename
field that is not included in the generated query, causing a validation error.IssueFields
type contains anauthor
field of typeOptional["IssueFieldsAuthor"]
that somehow seems to be undefined at instantiation, yielding the following error:The first issue disappears when including
__typename
in the generated query (in the clientget_issue
method).The second issue disappears when defining
IssueFieldsAuthor
beforeIssueFields
infragments.py
.Reproduction
Use the GitHub schema.
Generate the types with
ariadne-codegen
.Run the following:
Environment
Python 3.11.6
The text was updated successfully, but these errors were encountered: