Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Pagination container cache updates. #504

Merged
merged 2 commits into from
Jun 16, 2020
Merged

Pagination container cache updates. #504

merged 2 commits into from
Jun 16, 2020

Conversation

wtrocki
Copy link
Contributor

@wtrocki wtrocki commented Jun 15, 2020

Add ability to provide cache updates for the pagination/deltasync

@wtrocki
Copy link
Contributor Author

wtrocki commented Jun 15, 2020

@kingsleyzissou As we talked about it this is not going to land anywhere - it is very hacky change and it will work only with the https://graphqlcrud.org spec (like entire offix really)

The way I see this being accepted would be to make sane decision to deprecate cache package for general use and make it work for graphback stuff.

result.push(operationData_1);
}

} else if(result.items && result.items.find){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assumes items exsit for Pagination and sync (we use the same name)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact if pagination and sync is not wanted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zero. This will just make it work (so this else will never appear).
This can be also used upstream. if you want to wrap your offline data into some container you just need to name variable items.

Let's make build pass and release it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there is problem here. If someone will have named field find it will stop working for them. Chance for that is very low though.

I had much simpler implementation before that used items for checking but that can actually be field on the object.

@wtrocki
Copy link
Contributor Author

wtrocki commented Jun 15, 2020

CC @Eunovo for context. This is why we want datastore. It is not easy to work wit the cache. Updates are unpredictable and codebase is really hard to manage.

This fix is required to have datasync-starter working

wtrocki added a commit to aerogear/datasync-starter that referenced this pull request Jun 15, 2020
@kingsleyzissou
Copy link
Contributor

The way I see this being accepted would be to make sane decision to deprecate cache package for general use and make it work for graphback stuff.

I guess it that kind of makes sense because the cache helpers only seem to work with our stack because we make assumptions on how the inputs and return types are formatted (according to our stack). So custom update functions would be required when using a different backend anyway.

@wtrocki wtrocki changed the title WIP: Early version of pagination container Early version of pagination container Jun 16, 2020
object.items is going to be supported for automatic cache updates.
Which means that both deltasync and pagination will work out of the box
@wtrocki
Copy link
Contributor Author

wtrocki commented Jun 16, 2020

@kingsleyzissou Ready for review.

Verifcation would be to try sample app with the compiled version. I have tested it on the datasync-starter with the container and without container (master)

@wtrocki wtrocki changed the title Early version of pagination container Pagination container cache updates. Jun 16, 2020
@wtrocki
Copy link
Contributor Author

wtrocki commented Jun 16, 2020

Added small fix for 490

@wtrocki
Copy link
Contributor Author

wtrocki commented Jun 16, 2020

Released 0.16.0-dev2

@wtrocki wtrocki merged commit ef7ec4d into master Jun 16, 2020
@wtrocki wtrocki deleted the hardcode-pagination branch June 16, 2020 13:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants