hasura_connect 5.0.0+3 copy "hasura_connect: ^5.0.0+3" to clipboard
hasura_connect: ^5.0.0+3 copied to clipboard

Connect your Flutter/Dart apps to Hasura simply. All the power of GraphQL and Postgres in Flutter.

example/example.md

Example #

Query #

   var result = await hasuraConnect.query('''
    query getBooks {
        books {
          id
          name
        }
      }''');

    var listBooks = (result['data']['books'] as List).map((e) => Books.fromMap(e)).toList();


Mutation #

    var mutation = r'''
                  mutation addProduto($nome: String, $categoria: uuid, $tipo: uuid, $valor: float8) {
                    insert_produto(objects: {nome: $nome, categoria_produto_id: $categoria, tipo_produto_id: $tipo, valor: $valor}) {
                      affected_rows
                    }
                  }
              ''';

    var snapshot = await _hasuraConnect.mutation(mutation, variables: {
      "nome": descricao,
      "categoria": selectedCategoria,
      "tipo": selectedTipo,
      "valor": valor
    });

Mutation #

    var query = '''
              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"]) ?? [];
    });

Welcome to Hasura Connect!

203
likes
140
points
88
downloads

Publisher

verified publisherflutterando.com.br

Weekly Downloads

Connect your Flutter/Dart apps to Hasura simply. All the power of GraphQL and Postgres in Flutter.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

collection, dart_websocket, either_dart, http, meta, string_validator, uuid

More

Packages that depend on hasura_connect