Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fun apolloWebSocketHandler(executableSchema: ExecutableSchema, executionContext:
ConnectionInitError()
}

shouldReturn != null && shouldReturn.toString().startsWith("close") -> {
shouldReturn != null && shouldReturn.startsWith("close") -> {
val code = Regex("close\\(([0-9]*)\\)").matchEntire(shouldReturn)
?.let { it.groupValues[1].toIntOrNull() }
?: 1001
Expand Down Expand Up @@ -122,7 +122,7 @@ fun apolloWebSocketHandler(executableSchema: ExecutableSchema, executionContext:
private fun WebSocketMessage.toWsMessage(): WsMessage {
return when (this) {
is WebSocketBinaryMessage -> {
WsMessage(MemoryBody(data))
WsMessage(data)
}

is WebSocketTextMessage -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
public final class com/apollographql/execution/processor/ApolloProcessor : com/google/devtools/ksp/processing/SymbolProcessor {
public fun <init> (Lcom/google/devtools/ksp/processing/CodeGenerator;Lcom/google/devtools/ksp/processing/KSPLogger;Ljava/lang/String;Ljava/lang/String;)V
public fun finish ()V
public fun onError ()V
public fun process (Lcom/google/devtools/ksp/processing/Resolver;)Ljava/util/List;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class ExecutableSchemaBuilderBuilder(
override fun prepare() {}

override fun build(): FileSpec {
@file:OptIn(ApolloExperimental::class)
@OptIn(ApolloExperimental::class)
return FileSpec.builder(context.packageName, simpleName)
.addAnnotation(AnnotationSpec
.builder(ClassName("kotlin", "OptIn"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ public final class com/apollographql/execution/reporting/ApolloReportingOperatio
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun beforeField (Lcom/apollographql/apollo/execution/ResolveInfo;)Lcom/apollographql/apollo/execution/FieldCallback;
public fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public fun get (Lcom/apollographql/apollo/api/ExecutionContext$Key;)Lcom/apollographql/apollo/api/ExecutionContext$Element;
public synthetic fun getKey ()Lcom/apollographql/apollo/api/ExecutionContext$Key;
public fun getKey ()Lcom/apollographql/execution/reporting/ApolloReportingOperationContext$Key;
public fun minusKey (Lcom/apollographql/apollo/api/ExecutionContext$Key;)Lcom/apollographql/apollo/api/ExecutionContext;
public fun plus (Lcom/apollographql/apollo/api/ExecutionContext;)Lcom/apollographql/apollo/api/ExecutionContext;
public final fun toProtoTrace ()Lcom/apollographql/execution/reporting/Trace;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class ApolloNode(private val id: Any?) {
var type: String = ""
var startNanos: Long = 0L
var endNanos: Long = 0L
var value: ExternalValue? = null
var value: ExternalValue = null

fun toProtoNode(): Trace.Node {
val errors = mutableListOf<Trace.Error>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@file:OptIn(ExperimentalTime::class)
package com.apollographql.execution.reporting

import com.apollographql.apollo.ast.toUtf8
import com.apollographql.apollo.execution.FieldCallback
import com.apollographql.apollo.execution.ResolveInfo
import com.squareup.wire.ofEpochSecond
import kotlinx.datetime.Clock
import kotlin.time.Clock
import kotlin.time.ExperimentalTime
import kotlin.time.TimeSource.Monotonic.markNow

class ApolloOperationTracing {
Expand All @@ -13,6 +15,7 @@ class ApolloOperationTracing {
private val rootNode = ApolloNode(null)

internal val operationStartMark = markNow()

private val startInstant = Clock.System.now()

init {
Expand Down
4 changes: 4 additions & 0 deletions apollo-execution-subgraph/api/apollo-execution-subgraph.api
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
public final class com/apollographql/execution/subgraph/Ftv1Context : com/apollographql/apollo/api/ExecutionContext$Element {
public static final field Key Lcom/apollographql/execution/subgraph/Ftv1Context$Key;
public fun <init> ()V
public fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public fun get (Lcom/apollographql/apollo/api/ExecutionContext$Key;)Lcom/apollographql/apollo/api/ExecutionContext$Element;
public final fun getApolloOperationTracing ()Lcom/apollographql/execution/reporting/ApolloOperationTracing;
public synthetic fun getKey ()Lcom/apollographql/apollo/api/ExecutionContext$Key;
public fun getKey ()Lcom/apollographql/execution/subgraph/Ftv1Context$Key;
public fun minusKey (Lcom/apollographql/apollo/api/ExecutionContext$Key;)Lcom/apollographql/apollo/api/ExecutionContext;
public fun plus (Lcom/apollographql/apollo/api/ExecutionContext;)Lcom/apollographql/apollo/api/ExecutionContext;
}

public final class com/apollographql/execution/subgraph/Ftv1Context$Key : com/apollographql/apollo/api/ExecutionContext$Key {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.apollographql.execution.subgraph

import com.apollographql.apollo.api.json.ApolloJsonElement
import com.apollographql.apollo.ast.GQLBooleanValue
import com.apollographql.apollo.ast.GQLEnumValue
import com.apollographql.apollo.ast.GQLFloatValue
Expand All @@ -11,14 +12,13 @@ import com.apollographql.apollo.ast.GQLStringValue
import com.apollographql.apollo.ast.GQLValue
import com.apollographql.apollo.ast.GQLVariableValue
import com.apollographql.apollo.execution.Coercing
import com.apollographql.apollo.execution.JsonValue

object _AnyCoercing: Coercing<Any?> {
override fun serialize(internalValue: Any?): JsonValue {
override fun serialize(internalValue: Any?): ApolloJsonElement {
return internalValue
}

override fun deserialize(value: JsonValue): Any? {
override fun deserialize(value: ApolloJsonElement): Any? {
return value
}

Expand Down
31 changes: 16 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
[versions]
kotlin-plugin = "2.1.10"
ksp = "2.1.10-1.0.29"
apollo = "4.2.0"
ktor = "3.0.0"
kotlin-plugin = "2.3.0-RC"
ksp = "2.3.2"
apollo = "5.0.0-alpha.3"
ktor = "3.3.2"
spring = "3.3.3"

[libraries]
kgp = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin-plugin" }
#noinspection GradleDependency,NewerVersionAvailable compatibility with native consumers
kgp-min = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version = "1.9.0" }
java-diff-utils = { module = "io.github.java-diff-utils:java-diff-utils", version = "4.12" }
gradle-api-min = { group = "dev.gradleplugins", name = "gradle-api", version = "8.0" }
java-diff-utils = { module = "io.github.java-diff-utils:java-diff-utils", version = "4.16" }
gradle-api-min = { group = "dev.gradleplugins", name = "gradle-api", version = "8.11.1" }
apollo-ast = { group = "com.apollographql.apollo", name = "apollo-ast", version.ref = "apollo" }
apollo-compiler = { group = "com.apollographql.apollo", name = "apollo-compiler", version.ref = "apollo" }
apollo-api = { group = "com.apollographql.apollo", name = "apollo-api", version.ref = "apollo" }
apollo-execution = { group = "com.apollographql.apollo", name = "apollo-execution", version.ref = "apollo" }
atomicfu = "org.jetbrains.kotlinx:atomicfu:0.24.0"
kotlinpoet = "com.squareup:kotlinpoet:1.18.0"
kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.6.1"
arrowCore = "io.arrow-kt:arrow-core:1.2.4"
coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
atomicfu = "org.jetbrains.kotlinx:atomicfu:0.30.0-beta"
kotlinpoet = "com.squareup:kotlinpoet:2.2.0"
kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.7.1"
arrowCore = "io.arrow-kt:arrow-core:2.2.0"
coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2"
ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref ="ktor" }
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref ="ktor" }
ktor-server-cors = { group = "io.ktor", name = "ktor-server-cors", version.ref ="ktor" }
Expand All @@ -31,17 +32,17 @@ ksp-implementation = { module = "com.google.devtools.ksp:symbol-processing", ver
ksp-gradle = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" } # the Kotlin plugin resolves the version
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-plugin" }
http4k-bom = "org.http4k:http4k-bom:5.8.0.0"
http4k-bom = "org.http4k:http4k-bom:6.21.0.0"
http4k-core = { module = "org.http4k:http4k-core" }
http4k-realtime-core = { module = "org.http4k:http4k-realtime-core" }
http4k-server-undertow = { module = "org.http4k:http4k-server-undertow" }
http4k-server-netty = { module = "org.http4k:http4k-server-netty" }
librarian-gradle-plugin = "com.gradleup.librarian:librarian-gradle-plugin:0.0.11-SNAPSHOT-ba8b5ecfcbda070ecc3b5b95056ee359199552b4"
librarian-gradle-plugin = "com.gradleup.librarian:librarian-gradle-plugin:0.2.2-SNAPSHOT-44b68f3cb157b53cd19d63b93c6eeae967d1da4a"
apollo-execution-runtime = { module = "com.apollographql.execution:apollo-execution-runtime" }
apollo-execution-subgraph = { module = "com.apollographql.execution:apollo-execution-subgraph" }
spring-webflux = "org.springframework:spring-webflux:6.1.10"
spring-webflux = "org.springframework:spring-webflux:7.0.0"
wire-gradle-plugin = "com.squareup.wire:wire-gradle-plugin:5.3.1"
kotlinx-serialization-core = "org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3"
kotlinx-serialization-core = "org.jetbrains.kotlinx:kotlinx-serialization-core:1.9.0"
[plugins]
kgp-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
13 changes: 6 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -112,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
Expand Down Expand Up @@ -170,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )

JAVACMD=$( cygpath --unix "$JAVACMD" )

Expand Down Expand Up @@ -203,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
5 changes: 3 additions & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -68,11 +70,10 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
2 changes: 1 addition & 1 deletion librarian.root.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
java.compatibility=17
kotlin.compatibility=2.0.0
kotlin.compatibility=2.1.0

pom.groupId=com.apollographql.execution
pom.version=0.1.2-SNAPSHOT
Expand Down
Loading