twenty
twenty copied to clipboard
Remove edges and nodes from n+1
Scope & Context
In n+1 fields of a return from a request.
Current behavior
For example on the getViews request, we have a few nested sub queries, that are still wrapped in edges.
Expected behavior
Like mapPaginatedRecordsToRecords removes edges and nodes from any query and gives a simple array back, we want to apply the same on every n+1 fields.
### Tasks
- [ ] Fix GraphQLView type that is a workaround because of this
- [ ] Modify useModifyRecordFromCache, it should reverse this logic to properly update the cache which still has edges and nodes
- [ ] Filter unique record edges by node.id instead of cursor
See :
Places to add/remove nesting:
useFindManyRecords useCreateManyRecords and:
optimisticEffect : read/write from cache modifyCache: write in cache optimisticResponse for createMany?