You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL brings many benefits, both to the client: devices will need less requests, and therefore reduce data useage. And to the programer: requests are arguable, they have the same structure as the request.
29
+
30
+
The team at Apollo did a great job implenting GraphQL in Swift, Java and Javascript. But unfortunately they're not planning to release a Dart implementation.
31
+
32
+
This project is filling the gap, bringing the GraphQL spec to yet another programming language. We plan to implement most functionality from the [Apollo GraphQL client](https://github.com/apollographql/apollo-client) and from most features the [React Apollo](https://github.com/apollographql/react-apollo) components into Dart and Flutter respectively.
33
+
34
+
With that being said, the project lives currently still inside one package. We plan to spilt up the project into multiple smaler packages in the near future, to follow Apollo's modules design.
35
+
24
36
## Installation
25
37
26
38
First depend on the library by adding this to your packages `pubspec.yaml`:
27
39
28
40
```yaml
29
41
dependencies:
30
-
graphql_flutter: ^0.6.0
42
+
graphql_flutter: ^0.7.0
31
43
```
32
44
33
45
Now inside your Dart code you can import it.
@@ -201,6 +213,64 @@ new Mutation(
201
213
...
202
214
```
203
215
216
+
### Subscriptions (Experimental)
217
+
218
+
The syntax for subscriptions is again similar to a query, however, this utilizes WebSockets and dart Streams to provide real-time updates from a server.
219
+
Before subscriptions can be performed a global intance of `socketClient` needs to be initialized.
220
+
221
+
> We are working on moving this into the same `GraphqlProvider` stucture as the http client. Therefore this api might change in the near future.
You can always access the client direcly from the `GraphqlProvider` but to make it even easier you can also use the `GraphqlConsumer` widget.
@@ -221,7 +291,7 @@ You can always access the client direcly from the `GraphqlProvider` but to make
221
291
...
222
292
```
223
293
224
-
### Offline Cache
294
+
### Offline Cache (Experimental)
225
295
226
296
The in-memory cache can automatically be saved to and restored from offline storage. Setting it up is as easy as wrapping your app with the `CacheProvider` widget.
227
297
@@ -248,76 +318,21 @@ class MyApp extends StatelessWidget {
248
318
...
249
319
```
250
320
251
-
### Subscriptions (Experimental)
252
-
253
-
The syntax for subscriptions is again similar to a query, however, this utilizes WebSockets and dart Streams to provide real-time updates from a server.
254
-
Before subscriptions can performed the following code is required for initializing the global `socketClient` instance.
0 commit comments