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

Support custom scalars in json serialiser

Open aarne opened this issue 1 year ago • 0 comments

Currently only Int, Float, String, Boolean and ID scalars are supported while generating the json-schema for fast-json-stringify. Any unknown scalar triggers "Got unexpected PRIMITIVES type: XXX" error to be thrown.

https://github.com/zalando-incubator/graphql-jit/blame/9b2ef2036c820473044d8d9cef36a58f81ff9800/src/json.ts#L177

Prior to 0.8.2 the default type was {} (meaning AnySchema) instead of exception.

It would be nice the have a better support for custom scalars or at least restore the previous behaviour as in https://github.com/zalando-incubator/graphql-jit/blame/2df0bbfd6a6626d9f8230a30b5068ec1efaedbe0/src/json.ts#L165

aarne avatar Jul 07 '23 09:07 aarne