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

Roadmap for v4 #608

Closed
5 tasks done
micimize opened this issue Apr 19, 2020 · 22 comments · Fixed by #648
Closed
5 tasks done

Roadmap for v4 #608

micimize opened this issue Apr 19, 2020 · 22 comments · Fixed by #648

Comments

@micimize
Copy link
Collaborator

micimize commented Apr 19, 2020

There are a handful of open PRs and issues that I think should be parceled together for the next major version:

The main question is should we make a v4 branch or something to avoid every merge auto-publishing a breaking change? Or, should we rework CI such that master is the main development branch, and have master, beta, stable? Or should we just temporarily disable CI and then re-enable after achieving a stable API?

@HofmannZ @eusdima @mainawycliffe

@mainawycliffe
Copy link
Collaborator

Since we will most likely be introducing breaking changes, version 4 makes sense. Yeah, we can disable the ci temporarily and enable it ones we have an idea of what exactly we are testing and how to deal with it.

@teknolojia
Copy link

can we get cookie storage in v4?

@micimize
Copy link
Collaborator Author

micimize commented May 8, 2020

@teknolojia we can make cookie support a higher priority, yes

@micimize
Copy link
Collaborator Author

micimize commented May 8, 2020

I've decided to move working on graphql_flutter to the top of my priority queue, particularly working on v4.

To support development please sponsor me or the graphql-flutter open collective if you can.

@micimize micimize pinned this issue May 8, 2020
@klavs
Copy link
Collaborator

klavs commented May 8, 2020

FYI, @iscriptology just ported websocket link from graphql_flutter to gql_link.
I'm currently working on an ErrorLink with an example HttpAuthLink implementation.

For full feature parity, gql_link is missing file upload. (Because that's not a standardized feature of GraphQL).

Other than that, I feel that gql_link is soon to be ready for v4-alpha to be tested in the wild.

@micimize
Copy link
Collaborator Author

micimize commented May 9, 2020

Merged #564 & #565 and will be treating modularization as the v4 branch.

Some related todos for myself

@micimize
Copy link
Collaborator Author

Considering adding default json.encode logic / options to the roadmap (#642)

@micimize
Copy link
Collaborator Author

micimize commented May 23, 2020

@teknolojia v4 uses gql_link, for which there is gql_dio_link. dio has a cookie manager plugin for dart:io contexts and regular cookie support in the browser. Would that be enough for your session management?

http also has the withCredentials config in the browser, but seems fairly lacking in cookie support

@micimize
Copy link
Collaborator Author

micimize commented Jun 1, 2020

I've been making slow and steady progress here – got the starwars example running again today, and have been adding better docstrings. Will probably start diffing against beta to avoid clobbering recent changes and then publish an alpha version for people to start using tomorrow.

some things I might consider working on after a stable release candidate is ready:

@JigneshWorld
Copy link

JigneshWorld commented Jul 24, 2020

I got opportunity to play with v4 on flutter web.

For Authorization Token, I came to know that AuthLink is caching the token internally.
For some reason, I want to send a new token after some requests like the user logged out and new user logged in.

If there any possible way or workaround to update that new token on AuthLink and subsequent request called will be using the new token?

Reference: https://github.com/zino-app/graphql-flutter/blob/modularization/packages/graphql/lib/src/links/auth_link.dart

@LasseRosenow
Copy link

LasseRosenow commented Jul 24, 2020

@JigneshPatel23

There is an open isssue regarding this: #688

@LasseRosenow
Copy link

How do I correctly reset the cache in v4?

Right now I am doing this:

GraphQLProvider.of(context).value.cache.store.reset();

But I get a warning saying: The member 'store' can only be used within instance members of subclasses of 'package:graphql/src/cache/cache.dart'.

@micimize
Copy link
Collaborator Author

@lazylazyllama there isn't a better way right now – we should probably implement apollo's client.resetStore and refetch all live queries.

If you want to work around the warning I think you could do something like

extension on GraphQLCache {
  void resetStore() => store.reset();
}

@micimize
Copy link
Collaborator Author

based on #704 (comment) we really need gql-dart/gql#119 solved for backwards compatibility

@24601
Copy link

24601 commented Aug 24, 2020

Is there a roadmap/design for Local State Management? I have tried searching issues and don't see much, but would like to see where the thoughts are on this to see how we can consider contributing.

@micimize
Copy link
Collaborator Author

@24601 direct cache access can be used for local state management – we don't have any real examples yet but basically you can cache.writeQuery and writeFragment to write arbitrary queries to the cache that are then normalized.

@SanjiKir indicated he was using it in the discord. I think having some docs/examples of usage for it and typePolicies (also from normalize) would be a pretty beneficial contribution

@SanjiKir
Copy link

SanjiKir commented Aug 27, 2020

@micimize I wasn't using it as a local state magement. I believe these are 2 different paradigms and we shouldn't mix data layer and app state layer together. What I do is I write to the store on mutation response (if it's a new entity created, then gql will not write it to the query) so I don't have to refetch the query. And sometimes I use readQuery to get some data for my app state to work with, but I treat it as a data layer data, which can be changed at a million of places, whereas my app state can and should be changed only using an application itself.

@PhoenixPan
Copy link

@lazylazyllama there isn't a better way right now – we should probably implement apollo's client.resetStore and refetch all live queries.

If you want to work around the warning I think you could do something like

extension on GraphQLCache {
  void resetStore() => store.reset();
}

I am getting the same warning on the store given the extension method...should I put the extension somewhere particular? I am on graphql_flutter: ^4.0.0-alpha.2

image

@micimize
Copy link
Collaborator Author

@PhoenixPan you're right. I've just published 4.0.0-alpha.7 which makes the store public and adds an experimental client.resetStore that also refetches queries by default.

@HofmannZ
Copy link
Member

HofmannZ commented Oct 7, 2020

🎉 This issue has been resolved in version 4.0.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@micimize
Copy link
Collaborator Author

micimize commented Oct 7, 2020

closed with #648

@micimize micimize closed this as completed Oct 7, 2020
@micimize micimize mentioned this issue Oct 7, 2020
9 tasks
@micimize micimize unpinned this issue Oct 7, 2020
@HofmannZ
Copy link
Member

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants