Stylianos Gakis
05/25/2022, 8:05 AMmbonnin
05/25/2022, 8:05 AMmbonnin
05/25/2022, 8:06 AMStylianos Gakis
05/25/2022, 8:38 AMIn the worst case, response.data can be null if everything else is non-nullable.
, so I assume in that case we simply can not use partial responses.
Would the solution then be to have to define all of those queries as returning a nullable to be able to use partial responses? That would require a schema change too as I understand it.mbonnin
05/25/2022, 8:41 AMmbonnin
05/25/2022, 8:42 AMmbonnin
05/25/2022, 8:42 AMmbonnin
05/25/2022, 8:44 AM{
# if an error happens in this field, it will become null and will not take down nonNullField2
nonNullField1? {
...
}
nonNullField2 {
...
}
}
Stylianos Gakis
05/25/2022, 8:57 AMmbonnin
05/25/2022, 9:01 AMflipped version of @nonnull annotation?Yep
It might be a bit awkward to have one look like an annotation and the other have a question mark,The RFC also allows
!
instead of @nonnull
{
# same as nullableField @nonnull
nullableField!
}
Is there an ETA on this, or is it still being discussedDiscussions in the working group take a loooong time before they're in the spec but that doesn't prevent us from implementing it. The RFC has made a bunch of progress already
AS/IntelliJ don’t recognize it.Indeed, it's not standard so that's another reason we should work on an IntelliJ plugin. We're starting to think about it. Hopefully we can do something in 2022 🤞
Would this act as a “global @nonnull” sort of?Exactly! Which is my prefered solution at the moment. Making it in each query is flexible but a bit verbose IMO
Stylianos Gakis
05/25/2022, 11:11 AM!
and ?
instead would be awesome! They line up with what we’re used to in Kotlin almost perfectly as well, which is a nice side-effect 😄
IntelliJ pluginThe existing one is in my experience working perfectly for my needs, so if it’s just for small changes like that I’d hope you can just fork it and go from there. Much less work that way.
my prefered solution at the momentBut it’s not implemented yet right? I see the issue is still open, so probably haven’t had the chance to do it yet. With all that said however, then at the very moment, before the client site nullability is implemented, there’s no other alternative other than changing the schema itself right? If that’s the case I guess we can’t really use partial responses as changing the schema would mean the iOS and web clients will also be affected and I don’t think they’d appreciate that. Would a workaround be to use the existing downloadSchemaFromIntrospection Gradle task and manually change the types that we’d want to be nullable so that they only affect our client? Kinda like how we edited the schema in this discussion. Then the generate gradle task should generate them as nullable, and this wouldn’t change what the other clients are seeing.
mbonnin
05/25/2022, 11:24 AMBut it’s not implemented yet right?Right
With all that said however, then at the very moment, before the client site nullability is implemented, there’s no other alternative other than changing the schema itself right?Right
Would a workaround be to use the existing downloadSchemaFromIntrospection Gradle task and manually change the types that we’d want to be nullable so that they only affect our client?I think that'd work