You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now I like to only fulfil the signers part when it's requested as it's quite expensive.
So my simple mind thinks I can just do signers: t.field({ resolve() { /* etc */ } }) like:
exportdefaultbuilder.prismaNode(Prisma.ModelName.Transaction,{description: 'A transaction.',fields: (t)=>({// fields sender, creationtime, etc// ...cmd: t.field({resolve(parent){constsomeResult=fromDB();return{
...someResult,// here is what I want to dosigners: t.field({type: [Signer],resolve(parent){constsignersResult=fromDB();returnsignersResult;}})// this doesn't seem to work?}}})
But it seems not to work... What is going on here?
The text was updated successfully, but these errors were encountered:
GraphQL already works that way by default. It will only run the resolvers when the data is requested.
You can't just define more fields in a resolver though. The schema is generated before resolving queries, if you define the fields inside of a resolver, you aren't defining the fields until you are actually executing a query, which doesn't really make sense.
Just move that field definition to where ever you are defining your cmd type
I feel like I'm missing something very obvious.
I want to fulfill a query like this one:
Now I like to only fulfil the
signers
part when it's requested as it's quite expensive.So my simple mind thinks I can just do
signers: t.field({ resolve() { /* etc */ } })
like:But it seems not to work... What is going on here?
The text was updated successfully, but these errors were encountered: