Improve docs on Fragments, how exactly is it working
See original GitHub issueHey, so I am relying on data from the database to verify certain fields, so it seems using fragments would be beneficial for my use case. However I am not really sure how they work or what they do.
So there is this in the docs:
const isItemOwner = rule({
cache: 'strict',
fragment: 'fragment ItemID on Item { id }',
})(async ({ id }, args, ctx, info) => {
return ctx.db.exists.Item({
id,
owner: { id: ctx.user.id },
})
})
Does it provide a way to cache the data you get from the Item query or what is it doing here?
Also why are you getting id
from the parent
argument and not from args
? I would be happy if I could get some explanation of how exacyly fragments work together with graphql-shield.
(I know what fragments in general are, (I think))
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Fragments | Android Developers
Fragments introduce modularity and reusability into your activity's UI by allowing you to divide the UI into discrete chunks. Activities are an ...
Read more >Does using a document fragment really improve performance?
Document Fragment is much faster when it is used to insert a set of elements in multiple places. Most answers here point out...
Read more >Document Fragments and why you should use them
A document fragment is a fragment of a Document Object Model (DOM) tree, a chunk of tree that's separated from the rest of...
Read more >FINDING AND FIXING FRAGMENTS
A fragment is a group of words that does not function as a complete sentence and so cannot stand alone. It cannot begin...
Read more >Why You Should Use Document Fragments - Webtips
If you make heavy use of DOM manipulations, you might be want to optimize your calls by using document fragments. Find out how...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/maticzav/gimb-events/blob/master/server/src/shield.ts
Hope that helps.
@maticzav That does, thank you. I’ve been using prisma-client (which doesnt support the fragment option) and need to investigate switching over to the prisma-binding (which does)