apollographql / apollo-kotlin

:robot:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.7k stars 651 forks source link

ErrorBoundary #5913

Open sonatard opened 1 month ago

sonatard commented 1 month ago

Use case

Place an ErrorBoundary at the top level of your component hierarchy. This allows it to catch errors thrown by lower-level components and handle these errors with a fallback mechanism.

React docs https://ja.react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary

Jetpack Compose implementation https://docs.soil-kt.com/guide/query/hello-query#step-4-compose-runtime

Describe the solution you'd like

This eliminates the need for implementing error handling in individual components.

Reference

I created this issue to Jetpack Compose. https://issuetracker.google.com/issues/342247580

bignimbus commented 1 month ago

Related to https://github.com/apollographql/apollo-kotlin/issues/5914 and could also be complementary to the new nullability directives 🙏🏻