Comments (8)
Lets do that, I’ll start on a PR later today. We have to setup some test to track the performance impact on the queries. ✌🏼
from graphql-flutter.
@HofmannZ awesome! I'm on holiday right now 🍷🍷 and will check once back to desk.
from graphql-flutter.
@ened Thanks for the suggestion. @eusdima I think we discussed this internally.
Both solutions don't seem ideal. Providing the client with each query or mutation is too cumbersome. And a global client variable is not useful if you might want connect to multiple endpoints.
Instead I propose to create a GraphqlProvider
widget that takes a client as a param, and exposes it to all its children trough the context. This would mimic the behaviour of the ApolloProvider
What do you think?
from graphql-flutter.
Creating a provider and passing client as context seems good, but you will not be able to use the client outside of the provider so maybe support both: GraphqlProvider and the old way.
We have to do performance measurement to make sure that the memory and cpu usage are not higher after switching to the GraphqlProvider
.
So should we keep both or just GraphqlProvider
?
from graphql-flutter.
Well you can always declare the client somewhere in main.dart
then pass that client to the GraphqlProvider
. Now you can still use the client variable directly as needed.
We can also use ApolloConsumer to acces the compete client within the context tree.
from graphql-flutter.
GraphqlProvider
& GraphqlConsumer
seem to be the most flexible. People could still put the client in a global variable, but TBH that seemed like a stop-over solution anyway.
I do not understand how this could impact performance in a substantial way?
from graphql-flutter.
👆🏼 Early feedback is much appreciated
from graphql-flutter.
@ened,
I just finished PR #24, it implements the GraphqlProvider
& GraphqlConsumer
. I though you might want to have a look and give some feedback, since you brought the issue to light.
from graphql-flutter.
Related Issues (20)
- Extreme slowness/jank with JSON scalar
- UUID Out of Date HOT 2
- Example needed for cache HOT 2
- Documentation not clear about uploading file HOT 1
- Connection closed before full header was recieved error HOT 2
- Invalid result data when two list items nearly identical HOT 1
- Graphql Subscription not working HOT 2
- Not able to Mock the Result of Query Widget
- GraphQLDataProxy usage example fails with PartialDataException(path: __typename) HOT 1
- OperationException thrown from a WatchQuery operation
- Make `connectivity
- Make `connectivity_plus` optional.
- Failed to lookup host
- Failed to lookup host on all versions error
- Support latest version of http package
- WebSocketException: Connection to 'http://*************************#' was not upgraded to websocket HOT 3
- Please add support for connectivity_plus 6.0.2 HOT 3
- [WebsocketClient] onConnectionLost() not called when autoRecconect is false
- WASM support
- Invalid GraphQL request, extensions: {details: payload too large, code: INVALID_GRAPHQL_REQUEST}}]}))
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 graphql-flutter.