-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Not possible to mark parent as @required
if parent is nullable due to child being a nullable fragment
#1410
Comments
Hm maybe i'm missing something subtle in your issue but you wouldn't need to mark |
Thanks for replying readonly to: { ... } | null; means it is typed as nullable |
Sorry, but the point was that the field is nullable so i want to add @required, but houdini mistakenly says it is not nullable @AlecAivazis |
Commenting out this check makes it work. So it seems there is different logic in checking if houdini/packages/houdini/src/codegen/validators/typeCheck.ts Lines 409 to 416 in d7b30f0
|
What is the type of that field in your graphql schema? |
I think I made a patch that makes it work? But I might've done something weird the the existing logic.
I'm new to graphql, how can I see this? I use hasura with a postgres backend if it is of any help... |
I removed the irrelevant fields type flights {
to: airports!
}
type airports {
id: Int!
location: locations
}
type locations {
city: String!
} |
the |
Yes but |
Describe the bug
TLDR; if a query has a fragment with a
@required
in a top level field, it bubbles up to the query, but it's not possible to mark the parent of the fragment spread@required
.Example:
I have a fragment
And i use it in a query
Naturally, it leads to a nullable
to
:However, it is not possible to mark the
to
as required:If you try:
Reproduction
No response
The text was updated successfully, but these errors were encountered: