-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update Kotlin to 1.8.20 * update Ktor to 2.3.4 * update Gradle to 8.3 * update GraphQL-java to 21.1 * update coroutines to 1.7.3
- Loading branch information
Showing
27 changed files
with
135 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
group = project.rootProject.group | ||
version = project.rootProject.version | ||
|
||
val ktorVersion = "1.6.3" | ||
val ktorVersion = "2.3.4" | ||
|
||
dependencies { | ||
implementation(project(":server")) | ||
implementation("io.ktor:ktor-server-cio:$ktorVersion") | ||
implementation("io.ktor:ktor-websockets:$ktorVersion") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.5") | ||
implementation("io.ktor:ktor-server-websockets:$ktorVersion") | ||
implementation("io.ktor:ktor-server-cors:$ktorVersion") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
server-ktor/src/main/kotlin/com/arianegraphql/server/ktor/dsl/KtorPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
server-ktor/src/main/kotlin/com/arianegraphql/server/ktor/launcher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
package com.arianegraphql.ktx | ||
|
||
import graphql.GraphQLContext | ||
import graphql.schema.DataFetcher | ||
import kotlinx.coroutines.runBlocking | ||
|
||
interface Resolver<S, C> { | ||
suspend fun resolve(arguments: Argument, source: S, context: C?, info: Info): Any? | ||
interface Resolver<S> { | ||
suspend fun resolve(arguments: Argument, source: S, context: GraphQLContext, info: Info): Any? | ||
} | ||
|
||
@JvmInline value class FunctionalResolver<S, C>( | ||
private val lambda: suspend (arguments: Argument, source: S, context: C?, info: Info) -> Any? | ||
) : Resolver<S, C> { | ||
@JvmInline value class FunctionalResolver<S>( | ||
private val lambda: suspend (arguments: Argument, source: S, context: GraphQLContext, info: Info) -> Any? | ||
) : Resolver<S> { | ||
|
||
override suspend fun resolve( | ||
arguments: Argument, | ||
source: S, | ||
context: C?, | ||
context: GraphQLContext, | ||
info: Info | ||
) = lambda(arguments, source, context, info) | ||
} | ||
|
||
internal fun <S, C> Resolver<S, C>.toDataFetcher(): DataFetcher<Any?> = DataFetcher { env -> | ||
internal fun <S> Resolver<S>.toDataFetcher(): DataFetcher<Any?> = DataFetcher { env -> | ||
runBlocking { | ||
resolve(DataFetchingArgument(env), env.getSource(), env.getContext(), env) | ||
env.graphQlContext | ||
resolve(DataFetchingArgument(env), env.getSource(), env.graphQlContext, env) | ||
} | ||
} |
14 changes: 8 additions & 6 deletions
14
server/src/main/kotlin/com/arianegraphql/ktx/SubscriptionFilter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
server/src/main/kotlin/com/arianegraphql/ktx/TypeResolverBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.