Giter VIP home page Giter VIP logo

Comments (10)

wtrocki avatar wtrocki commented on May 12, 2024 2

What particular parts of the documentation are problematic?
We are actually working on improving documentation and sample app so any feedback is more than welcomed.
Offix is used in https://github.com/aerogear/ionic-showcase.

Demo video: https://www.youtube.com/embed/CrYinCtTHds

from offix.

wtrocki avatar wtrocki commented on May 12, 2024 2

Also worth note that we going to integrate with the Apollo 3.0 in upcoming releases that address pagination issues.

from offix.

darahayes avatar darahayes commented on May 12, 2024 1

@Hasan-git since the 0.9.0 release it's now possible to directly pass in your own InMemoryCache instance into OfflineClient.

const cache = new InMemoryCache();

const offlineClient = new OfflineClient({
  httpUrl: https://example.com/grapqhl,
  cache
});

We haven't got many test cases around how OfflineClient will behave using different cache instances with custom configs. If you could try that out and let us know how it works for you that would be great. If you have specific use cases and configurations in mind we could work to get some tests covering those.

from offix.

Hasan-git avatar Hasan-git commented on May 12, 2024

All human beings will be thankful for your efforts
Ionic showcase is a very good as startup.

What particular parts of the documentation are problematic?
We are actually working on improving documentation and sample app so any feedback is more than welcomed.
Offix is used in https://github.com/aerogear/ionic-showcase.

Demo video: https://www.youtube.com/embed/CrYinCtTHds

from offix.

Hasan-git avatar Hasan-git commented on May 12, 2024

how to add links and configure inMemoryCache ( cacheRedirects and dataIdFromObject ).

image

from offix.

wtrocki avatar wtrocki commented on May 12, 2024

So currently we creating a client for developers. Adding links is possible only by overriding the init method of the ApolloClient. However, we are hoping to extract links in the coming week so it will be available to be used with existing clients.

from offix.

Hasan-git avatar Hasan-git commented on May 12, 2024

image

the Query "allTasks" accepts argument ( first : Int ) imagine we are providing this query with arg value.

@ ROOT_QUERY

  • allTasks({ "first" : 1 })
  • allTasks({ "first" : 2 })
  • ...

how could updateQuery handle this situation.

In my case I am using pagination with arguments (filter, limit, page, sortBy, direction) then the queries should be invalid and out of date. But, in case the application is offline it should be able to resolve the query from store !?

I was thinking about invalidating the related queries, then any new request will pass through InMemoryCache "cacheRedirects" where I can get all items from store, the issue that I should loop over the whole cache to get the stored items by typename and then be able to resolve the data and build the query according to query arguments. but looping over the whole cache is not ideal and will cause performance drawbacks when the cache is growing and getting larger and larger.

from offix.

wtrocki avatar wtrocki commented on May 12, 2024

In my case I am using pagination with arguments (filter, limit, page, sortBy, direction) then the queries should be invalid and out of date. But, in case the application is offline it should be able to resolve the query from the store !?

I think we need to have another issue (this one is about documentation) where we will ask for the team to provide support for pagination which is actually really tricky to get now and it will require some heavy lifting on the developer side.
We had some use cases for Pagination but they were always business case specific,
which is really tricky to get right.

I think we can threat paginated results separately (by not caching them as other things by variables but only by globals. Then this means that we will be able to do client-side pagination on top of the data

I think for we also need to have a separate cache update helper for pagination and document pagination case separately. This is something that definitely is in our roadmap.

Do you mind creating a separate issue for that so we can address those issues faster?

We hit so many issues with InMemoryCache so I think from now on we probably going to fork it to this repository and address the issues.

ping @StephenCoady @darahayes

from offix.

wtrocki avatar wtrocki commented on May 12, 2024

To implement that:
I will use cacheRedirects:
Operate on the root object and ignoring the pages.
Have some simplified equivalent of the pagination.

This will also require us to always cache the data on a query without any arguments which is not supported now by our out of the box cache helpers. We can wait until our team will figure that out or you can try to hack something that will satisfy your needs.

Pagination is tricky and since there could be many business requirements to do it. It is hard to do it on a generic level. However, we can try to provide some helpers that will assume some format of pagination that should work for the cases where users can adjust their API to accept it.

from offix.

darahayes avatar darahayes commented on May 12, 2024

Closing this for now as it's possible to create and configure your own cache instance. Feel free to reopen if needed.

from offix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.