Use Apollo to download the scheme

This commit is contained in:
Syer10
2024-03-28 21:36:29 -04:00
parent 5b485086a7
commit cdf155c9f4
5 changed files with 104 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ jobs:
done
# Query the GraphQL endpoint and save the result to a file
curl -X POST -s http://localhost:4567/api/graphql > graphql/scheme.graphql
./gradlew :data:graphql:downloadApolloSchema --endpoint='http://localhost:4567/api/graphql' --schema=data/graphql/src/commonMain/graphql/schema.graphqls
# Kill the Java process
kill $pid

View File

@@ -21,6 +21,7 @@ plugins {
alias(libs.plugins.kotlinter) apply false
alias(libs.plugins.ktorfit) apply false
alias(libs.plugins.aboutLibraries) apply false
alias(libs.plugins.apollo) apply false
alias(libs.plugins.versions)
//id("com.louiscad.complete-kotlin") version "1.1.0"
}

View File

@@ -0,0 +1,98 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id(libs.plugins.kotlin.multiplatform.get().pluginId)
id(libs.plugins.kotlin.serialization.get().pluginId)
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.apollo.get().pluginId)
}
kotlin {
androidTarget {
compilations {
all {
kotlinOptions.jvmTarget = Config.androidJvmTarget.toString()
}
}
}
jvm("desktop") {
compilations {
all {
kotlinOptions.jvmTarget = Config.desktopJvmTarget.toString()
}
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
applyHierarchyTemplate {
common {
group("jvm") {
withAndroidTarget()
withJvm()
}
group("ios") {
withIosX64()
withIosArm64()
withIosSimulatorArm64()
}
}
}
sourceSets {
all {
languageSettings {
optIn("kotlin.RequiresOptIn")
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
val commonMain by getting {
dependencies {
api(libs.apollo)
}
}
val commonTest by getting {
dependencies {
}
}
val jvmMain by getting {
dependencies {
api(kotlin("stdlib-jdk8"))
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val desktopMain by getting {
}
val desktopTest by getting {
}
val androidMain by getting {
}
val androidUnitTest by getting {
}
val iosMain by getting {
}
val iosTest by getting {
}
}
}
android {
namespace = "ca.gosyer.jui.data.graphql"
}
apollo {
service("service") {
packageName.set("com.example.rocketreserver")
}
}

View File

@@ -38,6 +38,7 @@ kotlinInject = "0.6.3"
# Network
ktor = "2.3.9"
ktorfit = "1.12.0"
apollo = "3.8.3"
# Logging
slf4j = "2.0.12"
@@ -128,6 +129,7 @@ ktor-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "kt
ktor-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }
ktorfit-lib = { module = "de.jensklingenberg.ktorfit:ktorfit-lib-light", version.ref = "ktorfit" }
ktorfit-ksp = { module = "de.jensklingenberg.ktorfit:ktorfit-ksp", version.ref = "ktorfit" }
apollo = { module = "com.apollographql.apollo3:apollo-runtime", version.ref = "apollo" }
# Logging
logging-slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
@@ -183,6 +185,7 @@ ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
# Network
ktorfit = { id = "de.jensklingenberg.ktorfit", version.ref = "ktorfit" }
apollo = { id = "com.apollographql.apollo3", version.ref = "apollo" }
# Localization
moko-gradle = { id = "dev.icerock.mobile.multiplatform-resources", version.ref = "moko" }

View File

@@ -19,6 +19,7 @@ rootProject.name = "Tachidesk-JUI"
include("core")
include("i18n")
include("data")
include("data:graphql")
include("domain")
include("ui-core")
include("presentation")