Skip to content

Latest commit

 

History

History
 
 

ApolloGraphQL

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Supabase-kt ApolloGraphQL

Extends Supabase-kt with an Apollo GraphQL Client.

Newest version: Maven Central

Installation

dependencies {
    implementation("io.github.jan-tennert.supabase:apollo-graphql:VERSION")
}

Install plugin in main SupabaseClient. See the documentation for more information

val client = createSupabaseClient(
    supabaseUrl = "https://id.supabase.co",
    supabaseKey = "apikey"
) {
    //...
    
    install(GraphQL) {
        apolloConfiguration {
            // settings
        }
    }
    
}

Usage

The plugin automatically creates an Apollo Client with the corresponding headers for Authorization depending on your session.

To access the client, you can use the apolloClient property of the GraphQL plugin instance.

client.graphql.apolloClient.query(YourQuery()).execute().data //execute a query

To learn about how to use Apollo GraphQL, see Apollo Kotlin.