Skip to content

Files

Latest commit

f91defc · Mar 30, 2025

History

History

ApolloGraphQL

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 30, 2025
Sep 12, 2024
Sep 18, 2024

Supabase-kt ApolloGraphQL

Extends Supabase-kt with an Apollo GraphQL Client.

Supported targets:

Target JVM Android JS Wasm Apple
Status
In-depth Kotlin targets

JS: Browser, NodeJS

Wasm: wasm-js

Apple:

  • iOS: iosArm64, iosSimulatorArm64, iosX64

  • tvOS: tvosArm64, tvosX64, tvosSimulatorArm64

  • watchOS: watchosArm64, watchosX64, watchosSimulatorArm64

  • MacOS: macosX64, macosArm64

Installation

Newest version:

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

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

val supabase = 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.

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

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