Skip to content

[StrawberryShake] Custom scalar (non-null reference type) fails client to build when used as Input Type #5999

Answered by david-driscoll
Arsync asked this question in Q&A
Discussion options

You must be logged in to vote

I believe I've found a workaround, though this should be documented imo.

Change
directive @runtimeType(name: String!) on SCALAR
to
directive @runtimeType(name: String!, valueType: Boolean) on SCALAR

And then define your types as like

extend scalar DateTimeZone
    @serializationType(name: "global::System.String")
    @runtimeType(name: "global::NodaTime.DateTimeZone", valueType: true)
extend scalar Duration
    @serializationType(name: "global::System.String")
    @runtimeType(name: "global::NodaTime.Duration", valueType: true)
extend scalar Instant
    @serializationType(name: "global::System.String")
    @runtimeType(name: "global::NodaTime.Instant", valueType: true)

This seems to be wo…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Arsync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants