Is there some way to make a resolver return the same structure as a query from client? Let’s say I call query User($id: ID!) from client, but instead call query MyUser(...) from client where MyUser is a resolver that updates something on server, but should return the same object as if I called User(). Is this possible?
d
Daniel K.
03/22/2018, 3:08 PM
prisma or graphcool ?
structure of a return value depends on what do you have in your schema, if you have User type as a return type, then it's up to you to obtain that user somewhere and return it
j
Josef Henryson
03/22/2018, 4:17 PM
running graphcool still
Josef Henryson
03/22/2018, 4:18 PM
trying to return the object I get, but when defining the payload I get error saying that relations are not supported yet, and I don’t know if I can define the return payload in another way.
t
taikn
03/22/2018, 4:38 PM
You can define it in payload as a Json, e.g.: someField: Json