Skip to content

Commit

Permalink
Migrate to Apollo 4
Browse files Browse the repository at this point in the history
  • Loading branch information
wingio committed Aug 28, 2024
1 parent 9602d28 commit 0289e6a
Show file tree
Hide file tree
Showing 14 changed files with 63,172 additions and 31,308 deletions.
13 changes: 12 additions & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,24 @@ apollo {
service("service") {
packageName = "com.materiiapps.gloom.gql"

introspection {
endpointUrl = "https://api.github.com/graphql"
headers = mapOf(
// GLOOM_INTROSPECTION_TOKEN Should be set to the authorization token obtained after
// logging in to the mobile client, it should start with "gho_"
"Authorization" to "Bearer ${System.getenv("GLOOM_INTROSPECTION_TOKEN")}",
"User-Agent" to "Apollo GQL Introspection"
)
schemaFile = file("src/commonMain/graphql/com/materiiapps/gloom/gql/schemas/github.schema.graphqls")
}

mapScalarToKotlinString("URI")
mapScalarToKotlinString("HTML")
mapScalar("Date", "kotlinx.datetime.Instant", "com.materiiapps.gloom.api.utils.DateAdapter")
mapScalar(
"DateTime",
"kotlinx.datetime.Instant",
"com.apollographql.apollo3.adapter.KotlinxInstantAdapter"
"com.apollographql.adapter.datetime.KotlinxInstantAdapter"
)
}
}
Expand Down
Loading

0 comments on commit 0289e6a

Please sign in to comment.