graphql-request icon indicating copy to clipboard operation
graphql-request copied to clipboard

Wrong type for custom scalar (e.g. Date)

Open P4sca1 opened this issue 6 months ago • 3 comments

I am using the following DateTime custom scalar.

export const DateTime = Graffle.Scalars.create('DateTime', {
	decode: (value: string) => new Date(value),
	encode: (value: Date) => formatRFC3339(value),
})

When I try to access date methods on a returned object, I get the following issue, because all method types are replaced with {}.

Image Image

P4sca1 avatar Apr 14 '25 07:04 P4sca1