Skip to content

A Flutter application that consumes a GraphQL API using Hasura, demonstrating how to fetch, insert, update, and delete data from the API in a clean and efficient way.

License

Notifications You must be signed in to change notification settings

betazetadev/graphql-flutter-client

Repository files navigation

Flutter GraphQL App with Hasura Tutorial

This project was created for a tutorial on how to build a Flutter application that consumes a GraphQL API using Hasura. The application demonstrates how to fetch, insert, update, and delete data from the API in a clean and efficient way.

Table of Contents

Overview

This project covers the following topics:

  • Setting up Hasura and configuring a PostgreSQL database
  • Creating GraphQL queries, mutations, and subscriptions
  • Integrating GraphQL in a Flutter application using graphql_flutter
  • Building a simple CRUD application that interacts with the API

Requirements

Installation

  1. Clone the repository:
git clone https://codeberg.org/betazetadev/graphql-flutter-client.git
  1. Change into the project directory:
cd flutter-graphql-hasura-tutorial
  1. Install the dependencies:
flutter pub get
  1. Run the Docker container with Hasura and the PostgreSQL database:
docker-compose up -d
  1. Import and create the database information using this files connecting to the virtualized database.

  2. Add a code column to the language table with the default value set to gb (they are used to show a flag next to the film information):

Language Code
English gb
Japanese ja
Mandarin ma
French fr
German ge
Italian it
  1. Reload Hasura metadata to get the new column from the settings menu placed in the right upper corner of the admin panel listening in the local port 8080. You don't need to do this if you add the code column from the Hasura admin panel.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

A Flutter application that consumes a GraphQL API using Hasura, demonstrating how to fetch, insert, update, and delete data from the API in a clean and efficient way.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published