hasura_connect icon indicating copy to clipboard operation
hasura_connect copied to clipboard

Subscription will not work with Stream, return type is changed as future. How can we implement in new version with flutter.

Open ramsmart-inno opened this issue 2 years ago • 3 comments

ramsmart-inno avatar Sep 21 '22 02:09 ramsmart-inno

              subscription getProdutos {
                produto {
                  id
                  nome
                  valor
                  tipo_produto {
                    descricao
                  }
                  categoria_produto {
                    descricao
                  }
                }
              }''';

    var snapshot = await _hasuraConnect.subscription(query);

    var stream = snapshot.map((data) {
      return ProdutoModel.fromJsonList(data["data"]["produto"]) ?? [];
    });```

Bwolfs2 avatar Sep 21 '22 16:09 Bwolfs2

How do integrate with the presentation layer? Have some confusion with the stream builder while in the presentation layer.

Could you help me with a simple example? @Bwolfs2

ramsmart-inno avatar Sep 23 '22 00:09 ramsmart-inno

@ramsmart-inno https://github.com/Bwolfs2/loja_hasura

Bwolfs2 avatar Sep 26 '22 19:09 Bwolfs2