Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Persisted queries and better access to cacheย #74

@adjourn

Description

@adjourn

Im really intrigued by this library, mainly because of small size (Apollo adds almost 40Kb gzipped which is 1/3 of my bundle..) and simple core API to build my own thing with (e.g. on React hooks). Great job!

However I have few feature requests, I'd like to hear your opinion before even thinking about switching:

1. What do you think about reworking flush or adding a new API to access cache in app? Word flush seems odd in that context. Few options: method to read data by key or even expose map directly.

Direct access opens up so many possibilities which enables us to build pretty complex behaviors with these primitives, e.g. show partial data while loading when navigating from list view to detail view. I just tested it and 2 identical queries except with few different fields don't return the same item from cache (not sure if partial bug or intended, I never understood Apollo partial either).

2. Option to generate id for query objects and pass it to fetch function, then we're able to only send query id instead of whole query, less bytes to upload and ability to white-list (persisted queries). Preferably a hash based on query string, then we don't end up with same queries and different ids.

Neither of these features would really add any size to final bundle, persisted queries would be almost entirely babel-plugin feature and better cache access would be max few lines of code.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions