Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture documentation #2

Open
wtrocki opened this issue Jul 17, 2019 · 13 comments
Open

Architecture documentation #2

wtrocki opened this issue Jul 17, 2019 · 13 comments
Labels
apollo-offline documentation Improvements or additions to documentation

Comments

@wtrocki
Copy link

wtrocki commented Jul 17, 2019

Can you provide more info how you see offline functionalities being developed and how you see future of this library going forward?
Any info will be useful

@morrys
Copy link
Owner

morrys commented Jul 17, 2019

Soon I will create a roadmap within github to highlight the macro themes that will be addressed by the individual libraries.

The architecture and related documentation will be extended and integrated according to the needs of the community.

As for the apollo libraries, the features introduced extend the original ones without altering the behavior of the client when the network status is online.

@wtrocki
Copy link
Author

wtrocki commented Jul 17, 2019

Yes. I like the idea. Any reason why users will need to use custom replication protocol in execute? I see that you can change this to use the same graphql mutations and url. I meant there could be some motivation for that use case, but overal framework will be much simpler if offline data will be replicated seamlessly they same way.

Are you familiar wityh the concept of the Apollo-link-queue?
helfer/apollo-link-queue#3

It could seriously simplify your library.

@wtrocki
Copy link
Author

wtrocki commented Jul 17, 2019

Soon I will create a roadmap within github to highlight the macro themes that will be addressed by the individual libraries.

This sounds amazing!

@morrys
Copy link
Owner

morrys commented Jul 17, 2019

@wtrocki
Copy link
Author

wtrocki commented Jul 17, 2019

Yes.

@morrys
Copy link
Owner

morrys commented Jul 17, 2019

it is not mandatory to enter this option, by default the same link is used to execute mutations online.

I gave this opportunity just to give the possibility to insert custom logics for offline mutations.
For example, different retry links, different error handling, payload check or all those needs that may arise based on the use case.

@morrys
Copy link
Owner

morrys commented Jul 17, 2019

I could tell you a thousand possible solutions of use but without a requirement and / or a problem it is useless.

@wtrocki
Copy link
Author

wtrocki commented Jul 17, 2019

That is a really interesting approach. Is this global handler then or we can apply this with UI binding? Can I use Apollo component in react with this?

How enqueueing happens? When I hit client.mutate() and I'm offline do I get any response in promise or error or this will be blocked until the change is replicated to server?

I think I'm getting the entire framework slowly and this looks impressive.

@wtrocki
Copy link
Author

wtrocki commented Jul 17, 2019

Checked example: https://github.com/morrys/offline-examples/blob/master/apollo/todo/client/src/components/TodoOffline.js

It looks like there will be couple migration steps require to use it starting from vanilla Apollo application. It will be easy to avoid that IMHO assuming that offline mutations are not blocking.

@morrys
Copy link
Owner

morrys commented Jul 17, 2019

Queuing occurs asynchronously and responds to the UI with the optimistic response. It does not keep the ui locked and absolutely does not wait for any response from the server.

Execution is performed in the background once the connection becomes available (and it is also possible to manage it manually).

@morrys
Copy link
Owner

morrys commented Jul 17, 2019

Checked example: https://github.com/morrys/offline-examples/blob/master/apollo/todo/client/src/components/TodoOffline.js

this react component is the one I talk about in this comment: #3 (comment)

@morrys morrys added apollo-offline documentation Improvements or additions to documentation labels Jul 17, 2019
@wtrocki wtrocki closed this as completed Jul 17, 2019
@wtrocki wtrocki reopened this Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apollo-offline documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants