Skip to content

Deserializing specific scalar type #3777

Answered by kitten
willflitch asked this question in Q&A
Discussion options

You must be logged in to vote

This is probably not the answer you're looking for but it sounds like the operation you're doing is inherently "unsafe" or rather not a sane type derivation in a type system.

Basically, given that you have several inputs that serialise to JSON, some of them strings, technically speaking, only the schema can tell you if a given field's scalar is a Date (let's just call your type a date for now)

However, shipping a schema to the client-side (while possible and we do have a minification tool for that and someone has made an exchange for scalar deserialisation that uses this) is expensive inherently.
Similarly, crawling and cloning a response is similarly expensive and what you're doing is ba…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by JoviDeCroock
Comment options

You must be logged in to vote
0 replies
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