-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
issue: Cannot return null for non-nullable field AttacksListItem.name #645
Comments
After having a look at the data, it seems the underlying issue is the lack of a fallback value when providing the attack name. For example, consider https://github.com/tcgdex/cards-database/blob/master/data/Diamond%20%26%20Pearl/Majestic%20Dawn/65.ts: Since their attacks names are only provided for the german language, the API fails to fetch that card: {
card(id: "dp5-65") @locale(lang: "en") {
attacks { cost, damage, effect, name }
}
} This query fails but: {
card(id: "dp5-65") @locale(lang: "de") {
attacks { cost, damage, effect, name }
}
} This one is successfull. It would make a lot of sense to make this property nullable or provide a fallback value in this scenario |
Hi, after looking more, the problem is coming from another area, Cards that contains an attack MUST (at least it is currecntly always the case) hase a name, so the GraphQL API is correctly configured. If a card has one value in the correct language everything else should be filled. After testing my database I found the erroneous cards
I am currently fixing them manually and will update here when fixed ! |
Where are you having the issue
Is the issue affecting one of the two elements below ?
Description
When calling the API, a server error is thrown when
AttacksListItem.name
is null.Recreation steps
Just send the following query:
Expected behavior
API serves a set.
Current behavior
API fails with the folowing payload:
Context
https://www.apollographql.com/blog/using-nullability-in-graphql#what-happens-if-you-try-to-return-null-for-a-non-null-field
The text was updated successfully, but these errors were encountered: