Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix java type for event_time #1023

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Fix java type for event_time #1023

merged 1 commit into from
Dec 11, 2024

Conversation

velo
Copy link
Contributor

@velo velo commented Dec 4, 2024

Got the following error while trying to query event_time over graphql

09:52:21.203 [vert.x-eventloop-thread-0] WARN  notprivacysafe.graphql.execution.ExecutionStrategy - Can't serialize value (/CreateDeployment/event_time) : Expected something we can convert to 'java.time.OffsetDateTime' but was 'LocalDateTime'.
graphql.schema.CoercingSerializeException: Expected something we can convert to 'java.time.OffsetDateTime' but was 'LocalDateTime'.
	at graphql.scalars.datetime.DateTimeScalar$1.serialize(DateTimeScalar.java:51) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.scalars.datetime.DateTimeScalar$1.serialize(DateTimeScalar.java:39) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.completeValueForScalar(ExecutionStrategy.java:593) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:444) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:407) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:213) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680) ~[?:?]
	at java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658) ~[?:?]
	at java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2100) ~[?:?]
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:212) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:59) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.completeValueForObject(ExecutionStrategy.java:670) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:457) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:407) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:213) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642) ~[?:?]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2079) ~[?:?]
	at io.vertx.core.Future.lambda$toCompletionStage$3(Future.java:601) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.Promise.complete(Promise.java:66) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at com.datasqrl.graphql.MutationConfigurationImpl$1.lambda$visit$0(MutationConfigurationImpl.java:74) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureImpl$1.onSuccess(FutureImpl.java:91) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureImpl$ListenerArray.onSuccess(FutureImpl.java:310) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60) ~[sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [sqrl-run.jar:0.5.10-SNAPSHOT]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Fixes #728

@@ -3,5 +3,6 @@ mutation {
status: "underwriting", message: "The road goes ever on and on"}) {
loan_application_id
message
event_time
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails as expected:

FullUsecasesIT.testUseCase:243 Mismatched snapshots: loan_loan file:///Users/marvin/dataSQRL/sqrl/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/FullUsecasesIT/loan_loan.txt ==> expected: <>>>applicationalert-subscription.graphql
{"data":{"ApplicationAlert":[]}}
>>>applicationupdate-mutation.graphql
{"data":{"ApplicationUpdates":{"loan_application_id":101,"message":"The road goes ever on and on"}}}
> but was: <>>>applicationalert-subscription.graphql
{"data":{"ApplicationAlert":[]}}
>>>applicationupdate-mutation.graphql
{"errors":[{"message":"Can't serialize value (/ApplicationUpdates/event_time) : Expected something we can convert to 'java.time.OffsetDateTime' but was 'LocalDateTime'.","path":["ApplicationUpdates","event_time"],"extensions":{"classification":"DataFetchingException"}}],"data":{"ApplicationUpdates":{"loan_application_id":101,"message":"The road goes ever on and on","event_time":null}}}

@velo velo force-pushed the event_time_type branch 16 times, most recently from d4bf74f to fae1df4 Compare December 5, 2024 16:03
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
@velo velo force-pushed the event_time_type branch 2 times, most recently from 4eae1c1 to 21a5ced Compare December 10, 2024 14:52
@velo velo merged commit b34a32d into main Dec 11, 2024
1 check passed
@velo velo deleted the event_time_type branch December 11, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mutation with return type DateTime throws exception
2 participants