How does graphcool/prisma do the `json` data type?...
# prisma-whats-new
p
How does graphcool/prisma do the
json
data type? Sending back arbitrary objects from a resolver? Is that a custom defined schema type?
n
It's a custom scalar type.
p
Cool - thanks. Is it any more complex than: ?
Copy code
scalar JSON
Hope you are well and happy @nilan
🙌 1
n
Yes, it is 🙂
What are you trying to achieve?
p
I just want to send an arbitrarily shaped result object out - it’s the result of a search query from a JSON store - and the data might anything.
n
Ok - do you want to store that data using the Prisma
Json
field type as well, or is this only about your output type in the application layer?
p
Only my output layer. I think just what I have above works fine (unless I’m being naive). Don’t need to do anything more complex with it downstream.
n
Yes, if it's only for output you can indeed
scalar JSON
.