twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Remove edges and nodes from n+1

Open lucasbordeau opened this issue 2 years ago • 1 comments

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

lucasbordeau avatar Nov 30 '23 16:11 lucasbordeau

See :

Places to add/remove nesting:

useFindManyRecords useCreateManyRecords and:

optimisticEffect : read/write from cache modifyCache: write in cache optimisticResponse for createMany?

lucasbordeau avatar Jan 04 '24 14:01 lucasbordeau