flutter-graphql-upload-example
flutter-graphql-upload-example copied to clipboard
This repo is to demo how to upload files using GraphQL and Flutter.
Flutter GraphQL Image Uploads
This repo is to demo how to upload files using GraphQL and Flutter. The backend is build using Golang but can be run using docker - no need to install golang.
Backend
To run the backend, you can use docker compose, simply run docker-compose up -d --build
at the root directory.
Upload Image Mutation
To test the server, you can use the built in GraphiQL, whose URL is http://localhost:8080.
You can run the upload file Mutation below:
mutation($file: Upload!) {
upload(file: $file)
}
Frontend
To run the frontend, change directory to the flutter
directory, and run flutter run
. Make sure you have flutter installed.
Demo
Accompanying Post
You can find a detailed explanation for the fronted here.
Contributions
PR are welcome.