Skip to content

Instantly share code, notes, and snippets.

View sahalnazar's full-sized avatar
🏠
Working from home

Sahal Nazar sahalnazar

🏠
Working from home
View GitHub Profile
@sahalnazar
sahalnazar / ApolloRequestHandler.kt
Last active January 16, 2024 16:38
GraphQL request handler helper class for Apollo Client in Kotlin
import com.apollographql.apollo3.ApolloClient
import com.apollographql.apollo3.api.ApolloResponse
import com.apollographql.apollo3.api.Mutation
import com.apollographql.apollo3.api.Operation
import com.apollographql.apollo3.api.Query
import com.apollographql.apollo3.exception.ApolloException
import timber.log.Timber
/**
* This class handles the execution of GraphQL queries and mutations using the Apollo client.