Skip to content

question: how to use long for custom scalar #1723

@tenstad

Description

@tenstad

Custom scalar support - defaults to String but can be configured to deserialize to specific types

Is it possible to have the custom Long scalar be a Long instead of a String as the underlying type?
It is now quite strange to assert that the long values returned by the test-client is in fact strings.

Using this custom scalar:

    override fun willGenerateGraphQLType(type: KType): GraphQLType? = when (type.classifier) {
        Long::class -> ExtendedScalars.GraphQLLong

results in:

/**
 * Long type
 */
public typealias Long = String

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

    Issue actions