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

Run query in a MV* pattern #4

Closed
NeoDigi opened this issue Jun 19, 2018 · 2 comments
Closed

Run query in a MV* pattern #4

NeoDigi opened this issue Jun 19, 2018 · 2 comments
Labels
question Further information is requested

Comments

@NeoDigi
Copy link

NeoDigi commented Jun 19, 2018

Right now, if I understand correctly the query is a widget so it's building the UI with the result of the query.

Is it possible to run a query outside of a widget and just fet the result ?

@eusdima
Copy link
Contributor

eusdima commented Jun 19, 2018

For now, you can import the client.dart and call the method execute().
client.execute( query: '<YOUR_QUERY_STRING>', variables: variables, ); which returns Future<Map<String, dynamic>>

We will try to add a more elegant solution in the near future.

@eusdima eusdima added the question Further information is requested label Jun 19, 2018
@NeoDigi
Copy link
Author

NeoDigi commented Jun 19, 2018

Thank you for the quick respond, it's working perfectly!

hantrungkien pushed a commit to hantrungkien/graphql-flutter that referenced this issue May 24, 2024
1. Upgrate: connectivity_plus: ^6.0.3 for graphql_flutter package.
2. Resolve: error is throwed from graphql package (althought it doesn't make any crash) when toggleConnection != null

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ValueStream has no value. You should check ValueStream.hasValue before accessing ValueStream.value, or use ValueStream.valueOrNull instead.
#0      BehaviorSubject.value (package:rxdart/src/subjects/behavior_subject.dart:146:5)
zino-hofmann#1      SocketClient._listenToToggleConnection.<anonymous closure> (package:graphql/src/links/websocket_link/websocket_client.dart:264:40)
zino-hofmann#2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
zino-hofmann#3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
zino-hofmann#4      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
zino-hofmann#5      _MultiStreamController.addSync (dart:async/stream_impl.dart:1101:36)
zino-hofmann#6      _MultiControllerSink.add (package:rxdart/src/utils/forwarding_stream.dart:130:35)
zino-hofmann#7      _TakeUntilStreamSink.onData (package:rxdart/src/transformers/take_until.dart:13:31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants