prisma-binding icon indicating copy to clipboard operation
prisma-binding copied to clipboard

Add documentation for "fragments" element of a resolver

Open marktani opened this issue 7 years ago • 3 comments

You can use fragments for example for computed fields.

Example: https://github.com/graphcool/graphql-server-example/blob/master/src/resolvers/Home.ts#L5

fragments is used to ensure availability of data in the resolver independently of the actual incoming query.

This should be covered by documentation + examples.

marktani avatar May 10 '18 13:05 marktani

Hi, can you please give examples on how do you use those computed fields?

tomitrescak avatar Aug 30 '18 09:08 tomitrescak

Hi @marktani any updates on this issue yet!? I am desperately in need and the few solutions I've found (with fragment replacements) don't seem to work for me. Thanks in advance!

brainafesoh avatar Dec 31 '18 08:12 brainafesoh

Hi @brainafesoh,

Can you please tell me more about your use case?

Also, maybe this may help you: https://oss.prisma.io/content/graphql-binding/02-api-reference#addfragmenttoinfo. This function adds a field to the existing info.

pantharshit00 avatar Dec 31 '18 09:12 pantharshit00