Coder Social home page Coder Social logo

tailrocks / graphql-java-datetime Goto Github PK

View Code? Open in Web Editor NEW
145.0 7.0 28.0 1.14 MB

GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.

License: Apache License 2.0

Java 58.57% Shell 8.57% Kotlin 32.86%
graphql graphql-java scalars date time datetime

graphql-java-datetime's Introduction

graphql-java-datetime

License Latest Release PRs Welcome

GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.

Summary

A set of ISO 33601, RFC 3339 compatible date time scalars for GraphQL Java implementation (graphql-java), as well as starters for

Serialization

java.util.Date, java.time.LocalDate, java.time.LocalDateTime

Format JSON String
yyyy-MM-dd'T'HH:MM:ss.SSS'Z' 2017-07-09T13:14:45.947Z
yyyy-MM-dd'T'HH:MM:ss'Z' 2017-07-09T11:54:42Z
yyyy-MM-dd'T'HH:MM:ss 2017-07-09T11:54:42
yyyy-MM-dd 2017-07-09

java.time.LocalTime

Format JSON String
HH:MM:ss.SSS 17:59:59.129
HH:MM:ss 17:59:59
HH:MM 17:59

java.time.Duration

JSON String
PT1H30M
P1DT3H30M
P3Y6M4DT12H30M5S

Usage

Spring Boot

This library supports the following popular graphql-java framework:

Add one of the following starters according to your project.

Installation

Maven

Add the following to your pom.xml:

for GraphQL Java Kickstart:

<dependency>
    <groupId>com.tailrocks.graphql</groupId>
    <artifactId>graphql-datetime-kickstart-spring-boot-starter</artifactId>
    <version>6.0.0</version>
</dependency>

for Netflix DGS:

<dependency>
    <groupId>com.tailrocks.graphql</groupId>
    <artifactId>graphql-datetime-dgs-starter</artifactId>
    <version>6.0.0</version>
</dependency>

for Spring GraphQL:

<dependency>
    <groupId>com.tailrocks.graphql</groupId>
    <artifactId>graphql-datetime-spring-boot-starter</artifactId>
    <version>6.0.0</version>
</dependency>

Gradle

Add the following to your build.gradle:

for GraphQL Java Kickstart (Spring Boot):

implementation("com.tailrocks.graphql:graphql-datetime-kickstart-spring-boot-starter:6.0.0")

for DGS:

implementation("com.tailrocks.graphql:graphql-datetime-dgs-starter:6.0.0")

for Spring GraphQL:

implementation("com.tailrocks.graphql:graphql-datetime-spring-boot-starter:6.0.0")

Scalars

Add these scalars to your .graphqls schema file:

# java.util.Date implementation
scalar Date

# java.time.LocalDate implementation
scalar LocalDate

# java.time.LocalDateTime implementation
scalar LocalDateTime

# java.time.LocalTime implementation
scalar LocalTime

# java.time.OffsetDateTime implementation
scalar OffsetDateTime

# java.time.YearMonth implementation
scalar YearMonth

# java.time.Duration implementation
scalar Duration

You can rename the scalar however you want by simply adding the following properties to your application.yaml:

graphql:
  datetime:
    scalars:
      date:
        scalar-name: MyDate
      local-date:
        scalar-name: MyLocalDate
      local-date-time:
        scalar-name: MyLocalDateTime
      local-time:
        scalar-name: MyLocalTime
      offset-date-time:
        scalar-name: MyOffsetDateTime
      year-month:
        scalar-name: MyYearMonth
      duration:
        scalar-name: MyDuration

A custom format can be set for LocalDate and LocalDateTime only using the following properties in application.yaml

graphql:
  datetime:
    scalars:
      local-date:
        format: MM/dd/yyyy
      local-date-time:
        format: yyyy-MM-dd'T'HH:mm:ss

You can enable automatic zone conversion by adding the following property to your application.yaml. This will automatically convert between UTC and the default TimeZone for LocalDateTime:

graphql:
  datetime:
    scalars:
      zone-conversion-enabled: true

If using OffsetDateTime in order to present the offset and disable the automatic convertion to UTC from Jackson you should set to your application.yml the following:

spring:
  jackson:
    deserialization:
      adjust-dates-to-context-time-zone: false

Sample

Now you can use these scalars in your application. Here are graphql-datetime spring boot sample applications:

Bugs

To report any bug, please use the project Issues section on GitHub.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

License

Copyright © 2017-2023 Alexey Zhokhov. All rights reserved.

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

graphql-java-datetime's People

Contributors

dgmneto avatar donbeave avatar efimmatytsin avatar eugeneastashevich avatar fliptaboada avatar jasper-vandemalle avatar lesliemurphy avatar oliemansm avatar renovate-bot avatar renovate[bot] avatar setchy avatar vlad-buzea-ullink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphql-java-datetime's Issues

Publish to Maven

Kudos for the hard work!

Unfortunately, I can not find the dependency com.graphql-java:graphql-datetime-spring-boot-starter:2017-07-15T18-08-56 online.

I can not resolve it through Maven Central or JCenter.

I can of course get it from your GitHub repo, but could you publish it to a repository?

Update README

The library/plugin can not be found on maven, thats why the sonatype repository needs to be added. Maybe you could mention that in the readme for other users.

Gradle:
repositories { mavenCentral() maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" } }

Change LocalDateTime format

In README there is mentioned various formats.

But I don't see a way to actually change it.

I want to use yyyy-MM-dd'T'HH:MM:ss for LocalDateTime but can't see how to do.

The default format has a Z in the end that I want to remove.

Issue for 3.1.0 autoconfigure dependencies

Was scratching my head for a little bit until I realized that there is a incorrect Version property in graphql-datetime-autoconfigure

It is using Versions.springBoot when it indeed should be Versions.graphQlSpringBoot

This is causing transitive dependency issues for my maven builds

Autoconfiguration not working in Spring boot 3.0.0-RC2

Hello,

When I follow your instructions for Maven and Spring Boot to configure the environment, I get a lot of exceptions when the server starts.

I have had to manually copy GraphQlDateTimeAutoConfiguration, GraphQlDateTimeProperties and GraphQlDateTimeScalarsAutoConfiguration to my project, and then it works.
For any reason, your autoconfiguration seems to not be working with Spring boot 3.0.0-RC2.
I am also using Java 19 (just in case it could be also related to the issue).

Find some exceptions examples here:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'routerFunctionMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Error creating bean with name 'graphQlRouterFunction' defined in class path resource [org/springframework/boot/autoconfigure/graphql/servlet/GraphQlWebMvcAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQlRouterFunction' parameter 0: Error creating bean with name 'graphQlHttpHandler' defined in class path resource [org/springframework/boot/autoconfigure/graphql/servlet/GraphQlWebMvcAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQlHttpHandler' parameter 0: Error creating bean with name 'webGraphQlHandler' defined in class path resource [org/springframework/boot/autoconfigure/graphql/servlet/GraphQlWebMvcAutoConfiguration.class]: Unsatisfied dependency expressed through method 'webGraphQlHandler' parameter 0: Error creating bean with name 'executionGraphQlService' defined in class path resource [org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfiguration.class]: Unsatisfied dependency expressed through method 'executionGraphQlService' parameter 0: Error creating bean with name 'graphQlSource' defined in class path resource [org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfiguration.class]: Failed to instantiate [org.springframework.graphql.execution.GraphQlSource]: Factory method 'graphQlSource' threw exception with message: errors=[There is no scalar implementation for the named  'Date' scalar type, There is no scalar implementation for the named  'LocalDate' scalar type, There is no scalar implementation for the named  'LocalDateTime' scalar type, There is no scalar implementation for the named  'LocalTime' scalar type, There is no scalar implementation for the named  'OffsetDateTime' scalar type, There is no scalar implementation for the named  'YearMonth' scalar type, There is no scalar implementation for the named  'Duration' scalar type]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1753) ~[spring-beans-6.0.0-RC4.jar:6.0.0-RC4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.0-RC4.jar:6.0.0-RC4]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.0-RC4.jar:6.0.0-RC4]

...

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.graphql.execution.GraphQlSource]: Factory method 'graphQlSource' threw exception with message: errors=[There is no scalar implementation for the named  'Date' scalar type, There is no scalar implementation for the named  'LocalDate' scalar type, There is no scalar implementation for the named  'LocalDateTime' scalar type, There is no scalar implementation for the named  'LocalTime' scalar type, There is no scalar implementation for the named  'OffsetDateTime' scalar type, There is no scalar implementation for the named  'YearMonth' scalar type, There is no scalar implementation for the named  'Duration' scalar type]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) ~[spring-beans-6.0.0-RC4.jar:6.0.0-RC4]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648) ~[spring-beans-6.0.0-RC4.jar:6.0.0-RC4]
	... 86 common frames omitted
Caused by: graphql.schema.idl.errors.SchemaProblem: errors=[There is no scalar implementation for the named  'Date' scalar type, There is no scalar implementation for the named  'LocalDate' scalar type, There is no scalar implementation for the named  'LocalDateTime' scalar type, There is no scalar implementation for the named  'LocalTime' scalar type, There is no scalar implementation for the named  'OffsetDateTime' scalar type, There is no scalar implementation for the named  'YearMonth' scalar type, There is no scalar implementation for the named  'Duration' scalar type]
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:82) ~[graphql-java-19.2.jar:na]
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:58) ~[graphql-java-19.2.jar:na]
	at org.springframework.graphql.execution.DefaultSchemaResourceGraphQlSourceBuilder.initGraphQlSchema(DefaultSchemaResourceGraphQlSourceBuilder.java:112) ~[spring-graphql-1.1.0-RC1.jar:1.1.0-RC1]
	at org.springframework.graphql.execution.AbstractGraphQlSourceBuilder.build(AbstractGraphQlSourceBuilder.java:93) ~[spring-graphql-1.1.0-RC1.jar:1.1.0-RC1]
	at org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration.graphQlSource(GraphQlAutoConfiguration.java:94) ~[spring-boot-autoconfigure-3.0.0-RC2.jar:3.0.0-RC2]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139) ~[spring-beans-6.0.0-RC4.jar:6.0.0-RC4]

...

Add DGS-Framework compatible starter

We heavily use this library with our graphql-java-kickstart based APIs and it's been great.

For new graphql services, we've been experimenting with using the Netflix dgs-framework.

I'm raising this issue to see if there is an appetite to create/split into two separate starters, which would support either graphql-java-kickstart or dgs-framework

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update actions/setup-java action to v4

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

asdf
.tool-versions
  • java 17.0.9+9
github-actions
.github/workflows/build.yml
  • actions/checkout v4@3df4ab11eba7bda6032a0b82a6bb43b11571feac
  • actions/setup-java v3
  • actions/cache v3
  • actions/checkout v4@3df4ab11eba7bda6032a0b82a6bb43b11571feac
  • actions/setup-java v3
  • actions/cache v3
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
buildSrc/settings.gradle.kts
buildSrc/build.gradle.kts
buildSrc/src/main/kotlin/graphql-datetime-library-conventions.gradle.kts
buildSrc/src/main/kotlin/kotest-conventions.gradle.kts
gradle/libs.versions.toml
  • org.springframework.boot:spring-boot-dependencies 3.1.5
  • com.netflix.graphql.dgs:graphql-dgs-platform-dependencies 7.6.0
  • com.graphql-java-kickstart:graphql-spring-boot-starter 15.0.0
  • org.apache.commons:commons-text 1.10.0
  • com.graphql-java:graphql-java 21.3
  • com.tailrocks.gradle:maven-publish-conventions 0.5.1
  • com.tailrocks.gradle:signing-conventions 0.5.1
  • com.tailrocks.gradle:kotlin-conventions 0.6.1
  • com.tailrocks.gradle:junit-conventions 0.5.1
  • io.kotest:kotest-runner-junit5 5.8.0
  • io.kotest:kotest-assertions-core 5.8.0
  • io.kotest:kotest-framework-datatest 5.8.0
  • io.kotest.extensions:kotest-extensions-spring 1.1.3
  • com.adarshr.test-logger 3.2.0
  • com.tailrocks.spotless 0.2.0
  • com.tailrocks.java 0.2.0
  • com.tailrocks.idea 0.2.1
  • com.tailrocks.versions 0.2.0
  • io.spring.dependency-management 1.1.4
  • org.springframework.boot 3.1.5
gradle/repositoriesSettings.gradle.kts
graphql-datetime-dgs-autoconfigure/build.gradle.kts
graphql-datetime-dgs-starter/build.gradle.kts
graphql-datetime-kickstart-spring-boot-starter/build.gradle.kts
graphql-datetime-spring-boot-autoconfigure/build.gradle.kts
graphql-datetime-spring-boot-common/build.gradle.kts
graphql-datetime-spring-boot-starter/build.gradle.kts
graphql-java-datetime/build.gradle.kts
samples/dgs-webmvc/build.gradle.kts
samples/kickstart-webflux/build.gradle.kts
samples/kickstart-webmvc/build.gradle.kts
samples/spring-boot-webmvc/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.4

  • Check this box to trigger a request for Renovate to run again on this repository

Not working with webflux

Using the spring boot starter gives me the following error within a webflux environment :

The bean 'requestMappingHandlerAdapter', defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] and overriding is disabled.

Please upgrade graphql deps

The groupId was changed in the latest graphql libs.

com.graphql-java-kickstart graphql-java-servlet 7.1.1

java.util.Date implementation crashes

This happened with scalar Date.

When I given a date type like "2023-09-10" it crashes. And gives an error. I'll attach the error below.
But when I give a date type like "2023-09-14 14:00:00" it works fine. I tested in same code using various variables. All gave the same result. I'm sure i didn't passed any null values, and also when I'm getting results without using custom scalars and using the type as String (In both schema and entity class). It works fine.

FYI: My entity class' has Date data type. That's why I used this. If I use String as data type as above mentioned it works fine without scalar.

Here is the error :
(I've added full error incase of need)

java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:674) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.Execution.executeOperation(Execution.java:177) ~[graphql-java-20.2.jar:na]
at graphql.execution.Execution.execute(Execution.java:104) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.execute(GraphQL.java:557) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:476) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309) ~[na:na]
at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.executeAsync(GraphQL.java:439) ~[graphql-java-20.2.jar:na]
at org.springframework.graphql.execution.DefaultExecutionGraphQlService.lambda$execute$2(DefaultExecutionGraphQlService.java:83) ~[spring-graphql-1.2.3.jar:1.2.3]
at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:47) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.subscribeWith(Mono.java:4561) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.toFuture(Mono.java:5073) ~[reactor-core-3.5.11.jar:3.5.11]
at org.springframework.core.ReactiveAdapterRegistry$ReactorRegistrar.lambda$registerAdapters$5(ReactiveAdapterRegistry.java:272) ~[spring-core-6.0.13.jar:6.0.13]
at org.springframework.core.ReactiveAdapter.fromPublisher(ReactiveAdapter.java:121) ~[spring-core-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.function.DefaultAsyncServerResponse.create(DefaultAsyncServerResponse.java:186) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.function.ServerResponse.async(ServerResponse.java:250) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.graphql.server.webmvc.GraphQlHttpHandler.handleRequest(GraphQlHttpHandler.java:111) ~[spring-graphql-1.2.3.jar:1.2.3]
at org.springframework.web.servlet.function.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:107) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.0.13.jar:6.0.13]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.15.jar:6.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.0.13.jar:6.0.13]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.15.jar:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: java.lang.UnsupportedOperationException: null
at java.sql/java.sql.Date.toInstant(Date.java:316) ~[java.sql:na]
at com.tailrocks.graphql.datetime.DateTimeHelper.toLocalDateTime(DateTimeHelper.java:60) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.DateTimeHelper.toISOString(DateTimeHelper.java:54) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.GraphqlDateCoercing.serialize(GraphqlDateCoercing.java:57) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.GraphqlDateCoercing.serialize(GraphqlDateCoercing.java:39) ~[graphql-java-datetime-6.0.0.jar:na]
at graphql.schema.Coercing.serialize(Coercing.java:83) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForScalar(ExecutionStrategy.java:620) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:458) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) ~[graphql-java-20.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForObject(ExecutionStrategy.java:692) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:471) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:576) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:530) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:456) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) ~[graphql-java-20.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) ~[graphql-java-20.2.jar:na]
at graphql.execution.Execution.executeOperation(Execution.java:161) ~[graphql-java-20.2.jar:na]
... 58 common frames omitted

�[2m2023-12-01T11:22:02.510+05:30�[0;39m �[31mERROR�[0;39m �[35m79515�[0;39m �[2m---�[0;39m �[2m[nio-8080-exec-1]�[0;39m �[36mo.a.c.c.C.[.[.[/].[dispatcherServlet] �[0;39m �[2m:�[0;39m Servlet.service() for servlet [dispatcherServlet] threw exception

java.lang.UnsupportedOperationException: null
at java.sql/java.sql.Date.toInstant(Date.java:316) ~[java.sql:na]
at com.tailrocks.graphql.datetime.DateTimeHelper.toLocalDateTime(DateTimeHelper.java:60) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.DateTimeHelper.toISOString(DateTimeHelper.java:54) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.GraphqlDateCoercing.serialize(GraphqlDateCoercing.java:57) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.GraphqlDateCoercing.serialize(GraphqlDateCoercing.java:39) ~[graphql-java-datetime-6.0.0.jar:na]
at graphql.schema.Coercing.serialize(Coercing.java:83) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForScalar(ExecutionStrategy.java:620) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:458) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) ~[graphql-java-20.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForObject(ExecutionStrategy.java:692) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:471) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:576) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:530) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:456) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) ~[graphql-java-20.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) ~[graphql-java-20.2.jar:na]
at graphql.execution.Execution.executeOperation(Execution.java:161) ~[graphql-java-20.2.jar:na]
at graphql.execution.Execution.execute(Execution.java:104) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.execute(GraphQL.java:557) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:476) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309) ~[na:na]
at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.executeAsync(GraphQL.java:439) ~[graphql-java-20.2.jar:na]
at org.springframework.graphql.execution.DefaultExecutionGraphQlService.lambda$execute$2(DefaultExecutionGraphQlService.java:83) ~[spring-graphql-1.2.3.jar:1.2.3]
at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:47) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.subscribeWith(Mono.java:4561) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.toFuture(Mono.java:5073) ~[reactor-core-3.5.11.jar:3.5.11]
at org.springframework.core.ReactiveAdapterRegistry$ReactorRegistrar.lambda$registerAdapters$5(ReactiveAdapterRegistry.java:272) ~[spring-core-6.0.13.jar:6.0.13]
at org.springframework.core.ReactiveAdapter.fromPublisher(ReactiveAdapter.java:121) ~[spring-core-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.function.DefaultAsyncServerResponse.create(DefaultAsyncServerResponse.java:186) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.function.ServerResponse.async(ServerResponse.java:250) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.graphql.server.webmvc.GraphQlHttpHandler.handleRequest(GraphQlHttpHandler.java:111) ~[spring-graphql-1.2.3.jar:1.2.3]
at org.springframework.web.servlet.function.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:107) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.0.13.jar:6.0.13]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.15.jar:6.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.0.13.jar:6.0.13]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.15.jar:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

�[2m2023-12-01T11:22:02.510+05:30�[0;39m �[31mERROR�[0;39m �[35m79515�[0;39m �[2m---�[0;39m �[2m[nio-8080-exec-1]�[0;39m �[36mo.a.c.c.C.[.[.[/].[dispatcherServlet] �[0;39m �[2m:�[0;39m Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.UnsupportedOperationException] with root cause

java.lang.UnsupportedOperationException: null
at java.sql/java.sql.Date.toInstant(Date.java:316) ~[java.sql:na]
at com.tailrocks.graphql.datetime.DateTimeHelper.toLocalDateTime(DateTimeHelper.java:60) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.DateTimeHelper.toISOString(DateTimeHelper.java:54) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.GraphqlDateCoercing.serialize(GraphqlDateCoercing.java:57) ~[graphql-java-datetime-6.0.0.jar:na]
at com.tailrocks.graphql.datetime.GraphqlDateCoercing.serialize(GraphqlDateCoercing.java:39) ~[graphql-java-datetime-6.0.0.jar:na]
at graphql.schema.Coercing.serialize(Coercing.java:83) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForScalar(ExecutionStrategy.java:620) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:458) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) ~[graphql-java-20.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForObject(ExecutionStrategy.java:692) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:471) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:576) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:530) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:456) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422) ~[graphql-java-20.2.jar:na]
at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[na:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213) ~[graphql-java-20.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55) ~[graphql-java-20.2.jar:na]
at graphql.execution.Execution.executeOperation(Execution.java:161) ~[graphql-java-20.2.jar:na]
at graphql.execution.Execution.execute(Execution.java:104) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.execute(GraphQL.java:557) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:476) ~[graphql-java-20.2.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309) ~[na:na]
at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471) ~[graphql-java-20.2.jar:na]
at graphql.GraphQL.executeAsync(GraphQL.java:439) ~[graphql-java-20.2.jar:na]
at org.springframework.graphql.execution.DefaultExecutionGraphQlService.lambda$execute$2(DefaultExecutionGraphQlService.java:83) ~[spring-graphql-1.2.3.jar:1.2.3]
at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:47) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.subscribeWith(Mono.java:4561) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.toFuture(Mono.java:5073) ~[reactor-core-3.5.11.jar:3.5.11]
at org.springframework.core.ReactiveAdapterRegistry$ReactorRegistrar.lambda$registerAdapters$5(ReactiveAdapterRegistry.java:272) ~[spring-core-6.0.13.jar:6.0.13]
at org.springframework.core.ReactiveAdapter.fromPublisher(ReactiveAdapter.java:121) ~[spring-core-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.function.DefaultAsyncServerResponse.create(DefaultAsyncServerResponse.java:186) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.function.ServerResponse.async(ServerResponse.java:250) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.graphql.server.webmvc.GraphQlHttpHandler.handleRequest(GraphQlHttpHandler.java:111) ~[spring-graphql-1.2.3.jar:1.2.3]
at org.springframework.web.servlet.function.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:107) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) ~[spring-webmvc-6.0.13.jar:6.0.13]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.0.13.jar:6.0.13]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.15.jar:6.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.0.13.jar:6.0.13]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.15.jar:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.13.jar:6.0.13]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.13.jar:6.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.15.jar:10.1.15]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

Add property to convert between UTC and default ZoneId

The DateTimeHelper uses ZoneOffset.UTC for serializing and deserializing dates. The problem in our apps is that the LocalDateTime uses a different zone than UTC by default. So ZoneId.systemDefault() is equal to Amsterdam in our case.

It would be nice if we could enable a property to have the DateTimeHelper automatically convert between UTC and the ZoneId.systemDefault(). Default behavior would stay as is to not break the lib for anybody else using it.

Validation for incorrect LocalDate

I have the spring project with dependencies:

  • GraphQL Java Kickstart
  • and latest version of graphql-datetime-spring-boot-starter
  • defined date format is 'yyyy-MM-dd'
    But when I pass incorrect date '2020-53-23', there is no error.

I would expect to get an error in the response instead of empty object. Is there the way to accomplish this?

incompatible types

I have added the compile script to my gradle config but during the gradle build I am getting the following error.

error: incompatible types: DataLoaderRegistry cannot be converted to DataLoaderDispatcherInstrumentationOptions
            = new DataLoaderDispatcherInstrumentation(getDataLoaderRegistry());

any thoughts on why this is happening? I have not changed any code yet in my project and have a successful build before adding the compile script.

There is no scalar implementation for the named 'LocalDateTime' scalar type

Hello. Thank you very much for making this library publicly available. I'm trying to use LocalDateTime for a project and I'm getting a message saying there's no scalar named LocalDateTime scalar type, as below:

Caused by: graphql.schema.idl.errors.SchemaProblem: errors=[There is no scalar implementation for the named  'LocalDateTime' scalar type]
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:80) ~[graphql-java-17.3.jar:na]
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:56) ~[graphql-java-17.3.jar:na]
	at org.springframework.graphql.execution.DefaultGraphQlSourceBuilder.build(DefaultGraphQlSourceBuilder.java:142) ~[spring-graphql-1.0.0-M5.jar:na]
	at org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration.graphQlSource(GraphQlAutoConfiguration.java:88) ~[spring-boot-autoconfigure-2.7.0-M1.jar:2.7.0-M1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.15.jar:5.3.15]
	... 108 common frames omitted

What I've done

Step 1

Added the Maven dependency.

<dependency>
	<groupId>com.zhokhov.graphql</groupId>
	<artifactId>graphql-datetime-spring-boot-starter-webflux</artifactId>
	<version>4.1.0</version>
</dependency>

Step 2

Added scalar LocalDateTime to my .graphqls schema file.

Question

Is there anything I'm missing? I looked through the README and the WebFlux sample project, but couldn't figure it out. If further data is needed, the pet project I'm working on is publicly available here.

Zone conversion is not applied to LocalDate

I ran into the issue that Apollo Client sends a Date for a LocalDate scalar with time included. Zone conversion is not applied by GraphQLLocalDate resulting in an incorrect date being parsed. Will create a PR to extend zone conversion support to the GraphQLLocalDate scalar. Will check GraphQLLocalTime while I'm at it too.

Make type name configurable

I have a GraphQL Schema that I don't like to change. It defines a scalar type "DateTime". It matches to your "GraphQLLocalDateTime", however, in your implementation the name "LocalDateTime" is used and therefore GraphQL-Java is complaining.

Can we make the name of the type configurable? A possible solution would be to add a second constructor that accepts the "name" argument (and maybe also the description?) and reuses the Coercing that you have created. At least in my use-case this would solve my problem. Would you accept such a pull-request?
Is there any other solution?

Thanks a lot

bean 'schemaStringProvider' could not be registered

I am using graphql-spring-boot-starter 5.0.2 with graphql-java-tools 5.2.4.

When I try to add graphql-datetime-spring-boot-starter 1.9.0 to use LocalDateTime in my schema, I get this error:

The bean 'schemaStringProvider', defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLJavaToolsAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class] and overriding is disabled.

Version 2.1.0 maven repository

Hello,

Thank you for the amazing work on this library.
But why version 2.1.0 is not available on the maven repository ?

Thanks,

Update to graph kickstart 6

We've recently upgraded to

        <dependency>
            <groupId>com.graphql-java-kickstart</groupId>
            <artifactId>graphql-spring-boot-starter</artifactId>
            <version>6.0.0</version>
        </dependency>

And now we're getting errors:

Caused by: java.lang.ClassNotFoundException: com.oembedler.moon.graphql.boot.GraphQLJavaToolsAutoConfiguration

I noticed that in master it's already been changed to the correct class name: https://github.com/donbeave/graphql-java-datetime/blob/master/graphql-datetime-autoconfigure/src/main/java/com/zhokhov/graphql/datetime/boot/GraphQLDateTimeAutoConfiguration.java#L29

When can this be released?

Duration support

What do you think about adding support for ISO 8601 duration?

Support for OffsetDateTime

Needed this so wrote my own (pasted below). I also was unable to use this library because graphql-java doesn't allow clients to change the scalar name (I wanted a Java LocalDate to be called just Date as a scalar in graphql).

This more closely matches the behavior I expect https://www.npmjs.com/package/graphql-iso-date to have wrt its Date and DateTime scalars.

    // example: 2007-12-03T10:15:30+01:00
    // example: 2007-12-03T10:15:30Z
    public static final GraphQLScalarType OFFSET_DATE_TIME_TYPE = new GraphQLScalarType("Timestamp",
            "A Java OffsetDateTime",
            new Coercing<OffsetDateTime, String>() {
                private OffsetDateTime convertImpl(Object input) {
                    if (input instanceof String) {
                        try {
                            return OffsetDateTime.parse((String) input, DateTimeFormatter.ISO_OFFSET_DATE_TIME);
                        } catch (DateTimeParseException ignored) {
                            return null;
                        }
                    }
                    return null;
                }

                @Override
                public String serialize(Object input) {
                    if (input instanceof OffsetDateTime) {
                        return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format((OffsetDateTime) input);
                    } else {
                        OffsetDateTime result = convertImpl(input);
                        if (result == null) {
                            throw new CoercingSerializeException(
                                    "Invalid value '" + input + "' for Timestamp (a Java OffsetDateTime)");
                        }
                        return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(result);
                    }
                }

                @Override
                public OffsetDateTime parseValue(Object input) {
                    OffsetDateTime result = convertImpl(input);
                    if (result == null) {
                        throw new CoercingParseValueException(
                                "Invalid value '" + input + "' for Timestamp (a Java OffsetDateTime)");
                    }
                    return result;
                }

                @Override
                public OffsetDateTime parseLiteral(Object input) {
                    if (!(input instanceof StringValue)) {
                        return null;
                    }
                    String value = ((StringValue) input).getValue();
                    OffsetDateTime result = convertImpl(value);
                    return result;
                }
            });

    // example: 2012-01-05
    public static final GraphQLScalarType LOCAL_DATE_TYPE = new GraphQLScalarType("Date", "A Java LocalDate",
            new Coercing<LocalDate, String>() {
                private LocalDate convertImpl(Object input) {
                    if (input instanceof String) {
                        try {
                            return LocalDate.parse((String) input, DateTimeFormatter.ISO_LOCAL_DATE);
                        } catch (DateTimeParseException ignored) {
                            return null;
                        }
                    }
                    return null;
                }

                @Override
                public String serialize(Object input) {
                    if (input instanceof LocalDate) {
                        return DateTimeFormatter.ISO_LOCAL_DATE.format((LocalDate) input);
                    } else {
                        LocalDate result = convertImpl(input);
                        if (result == null) {
                            throw new CoercingSerializeException(
                                    "Invalid value '" + input + "' for Date (a Java LocalDate)");
                        }
                        return DateTimeFormatter.ISO_LOCAL_DATE.format(result);
                    }
                }

                @Override
                public LocalDate parseValue(Object input) {
                    LocalDate result = convertImpl(input);
                    if (result == null) {
                        throw new CoercingParseValueException(
                                "Invalid value '" + input + "' for Date (a Java LocalDate)");
                    }
                    return result;
                }

                @Override
                public LocalDate parseLiteral(Object input) {
                    if (!(input instanceof StringValue)) {
                        return null;
                    }
                    String value = ((StringValue) input).getValue();
                    LocalDate result = convertImpl(value);
                    return result;
                }
            });

dependencies are omitted for conflict

Hi,
First of all, nice work with this library!
In my project I'm using graphql-spring-boot-starter with graphql-java-tools, but unfortunately I'm not able to use your library.
After I configured my settings to get the dependency from jcenter.bintray.com, It gave me some errors saying that some dependencies are omitted for conflict - I attached the screen-shot.

Building from the command line says:
[WARNING] The POM for com.graphql-java:graphql-java:jar:2017-07-11T00-52-23 is missing, no dependency information available
Which is in conflict with version 4.1.2 as you can see in screenshot.

In my pom I have:

com.graphql-java
graphql-spring-boot-starter
3.9.2


com.graphql-java
graphql-java-tools
4.1.2

Thanks,

  • Roland

graphql-datetime

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.