Comments (6)
Ok, this issue should be fixed in the latest version.
You can set a dependency_override on rxdart for the beta version.
from ferry.
To handle pagination, you need to specify an updateResult
callback, not an UpdateCacheHandler. Take another look at the docs.
Also, a few notes:
- Results will only be updated if the request has the same
requestId
. If norequestId
is specified, a unique ID will be generated automatically. If you're using Flutter, make sure you either instantiate the request outside of thebuild()
method (so that it doesn't get instantiated on every build with a new ID) or explicitly provide an ID. - Ferry doesn't have any way of knowing that a
getItem(id)
query should return one of the results previously returned by
agetItems()
query. You can specify aFieldPolicy.read()
function on thegetItems
field of yourQuery
Typepolicy to allow for this behavior, but working with TypePolicies and FieldPolicies is not yet well documented. (although this functionality closely mirrors Apollo's use of TypePolicies, so their docs on this topic could provide you some guidance).
from ferry.
Thanks @smkhalsa for explaining this to me, I am aware of updateResult
function and I am using it.
Maybe I did not explain the issue clearly, here are steps I am doing
getItems(limit = 10, offset = 0)
this function will keep listening to the result items- I do update an item at index between 0 and 10 using a mutation request and I do update the item fragment using
writeFragment()
- The listener from step 1 will get a new event with the updated fragment from cache and then from server.
- I do the pagination process as in the docs, rebuild the request and add it to the requestController
updateResult
is called to add the new items to the previous, and then the listener from step 1 called with the new list. - If I update an item indexed 10 to 20 (using
writeFragment
) the listener from step 1 is called; but if I update an item indexed 0 to 10 the listener from step ` is NOT called which is an issue form me.
I want to know the behavior is step 5 is expected or is it a bug?
Thanks again for the answer and this great library
from ferry.
Are you using the latest version of ferry (0.8.0)?
from ferry.
No, I am using ferry: ^0.7.6 I could not upgrade because of the rxdart version.
Is it possible to make the rxdart version as a range
something like rxdart: ">=2.0.0 <3.0.0"
from ferry.
Thanks, it is working fine after the upgrade.
from ferry.
Related Issues (20)
- [Update] Update ferry_generator analyzer HOT 3
- Request stream doesn't listen to loading state
- Custom scalar serializer - InvalidType error HOT 1
- Error generating classes for mutation that returns a union HOT 3
- Cannot use `tristate_optionals: true` in mutations having lists in their parameters HOT 5
- Custom ISO serializer for DateTime HOT 5
- How to remove the `__typename` in the `toJson` of a fragment HOT 2
- Change in cache doesn't propagate HOT 28
- [Feature Request] Add `ContextEntries` to requests that can be retrieved in custom `gql` `Link` HOT 9
- [Feature Request] Access properties using Maps (ferry_generator) HOT 3
- [question]: Freezed support HOT 4
- [Feature Request] a CLI that output unused field/argument in the schema HOT 1
- Generating tristate_optionals generates invalid code with mixed up imports HOT 10
- Unable to Upload Multipart File with dio link HOT 2
- ferry_flutter: endless loading state after the cache has been cleared HOT 1
- Null check operator used on a null value and "Bad Element" HOT 1
- schema.schema.gql.dart not generated - "possibleTypesMap" missing HOT 2
- Ferry cannot decompose fragment on TypeCondition HOT 1
- Manually update the ferry data HOT 1
- TypePolicy is broken Or there is no clear documentation about it. HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ferry.