Skip to content

LocalTime scalar does not implement valueToLiteral that is used by DGS #156

Open
@markwimpory

Description

@markwimpory

Describe the bug

DGS uses the valueToLiteral method on Cooercing. This has NOT been implements by the LocalTimeCooercinf class so we get an Unsupported Operation Exception. This scalar is also not in line with the other scalars that inline their coercing class.

java.lang.UnsupportedOperationException: The non deprecated version of valueToLiteral has not been implemented by this scalar : class graphql.scalars.datetime.LocalTimeCoercing

at graphql.schema.Coercing.valueToLiteral(Coercing.java:222)
at graphql.schema.Coercing.valueToLiteral(Coercing.java:240)
at com.netflix.graphql.dgs.client.codegen.InputValueSerializer.getOptionalValue(InputValueSerializer.kt:98)
at com.netflix.graphql.dgs.client.codegen.InputValueSerializer.toValue(InputValueSerializer.kt:70)
at com.netflix.graphql.dgs.client.codegen.InputValueSerializer.toValue$lambda$1(InputValueSerializer.kt:83)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:816)
at com.netflix.graphql.dgs.client.codegen.InputValueSerializer.toValue(InputValueSerializer.kt:84)
at com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest.serialize(GraphQLQueryRequest.kt:92)
at com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest.serialize(GraphQLQueryRequest.kt:75)
at uk.gov.hmpo.crpf.csor.birthapi.graphql.GraphQLClientHelper.getRequest(GraphQLClientHelper.java:85)
at uk.gov.hmpo.crpf.csor.birthapi.graphql.BirthCreationHelper.createSingleBirth(BirthCreationHelper.java:30)

To Reproduce

The following code implements this fix and adds a test for this scalar.

Make_LocalTime_scalar_the_same_as_other_scalars___Also_fixed_issue_where_valueToLiteral_wa1.patch

Activity

bbakerman

bbakerman commented on Jun 15, 2025

@bbakerman
Member

I have addressed this in the linked PR and also took some of the tests from your patch to help with that.

The PR ended up being much more than just this issue - its all deprecated coercing methods removed and tests updated but yours is in there

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bbakerman@markwimpory

        Issue actions

          LocalTime scalar does not implement valueToLiteral that is used by DGS · Issue #156 · graphql-java/graphql-java-extended-scalars