nhost / nhost-dart

Nhost Dart & Flutter packages
https://nhost.io
MIT License
90 stars 32 forks source link

How to use Hasura GQL subscription query? #134

Closed vipafattal closed 8 months ago

vipafattal commented 8 months ago

I need on how to use subscription query with the gql client i.e.

subscription($id:uuid!) {
  products_by_pk(id: $id){
   id
   title
  }
 }

I can see there is SubscriptionOption query but not sure what to provide for the document param, could provide an example for how to use the SubscriptionOption?

thanks

dbarrosop commented 8 months ago

You can look at the example we have here: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_flutter_graphql/example

For instance, https://github.com/nhost/nhost-dart/blob/main/packages/nhost_flutter_graphql/example/lib/todos_quick_start_example.dart#L72

If you have further questions, please, don't use github issues, use a discussion or join our discord