Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linbudu599/flutter_graphql_example
Use GraphQL in Flutter. π
https://github.com/linbudu599/flutter_graphql_example
flutter graphql graphql-flutter
Last synced: 10 days ago
JSON representation
Use GraphQL in Flutter. π
- Host: GitHub
- URL: https://github.com/linbudu599/flutter_graphql_example
- Owner: linbudu599
- License: mit
- Created: 2020-10-03T07:15:32.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-28T23:46:28.000Z (over 1 year ago)
- Last Synced: 2024-10-12T14:10:49.902Z (26 days ago)
- Topics: flutter, graphql, graphql-flutter
- Language: Dart
- Homepage:
- Size: 224 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter-GraphQL-Example
A simple demo shows basic usage of combination of `Flutter` & `GraphQL`.
## Article
**[WIP]** [ε¨ Flutter δΈδ½Ώη¨ GraphQL](./docs/README.md)
## Notice
To solve **'Insecure HTTP is not allowed by platform' Error**, You will need to do these things:
For Android:
- Create [`/res/xml/network_security_config.xml`](android/app/src/main/res/xml/network_security_config.xml).
- Edit [`AndroidManifest.xml`](android/app/src/main/AndroidManifest.xml).```xml
```
For IOS:
- Add [NSExceptionDomains( NSExceptionAllowsInsecureHTTPLoads )](https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity/nsexceptiondomains) to `Info.plist` in `/ios/Runner/Info.plist` folder.
Above actions are required so that we can use **HTTP instead of HTTPS** request in Emulator Device, see [here](https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android#migration-guide) for more details about.
## Prerequisites
**Make sure you've already finished required environment setup, including:**
- `nodejs`
- `flutter` & `dart`
- `Android/IOS Emulator`## Usage
- **Declarative Usage**: [ToDo List](lib/todolist/todolist.dart)
```bash
git clone [email protected]:linbudu599/flutter_graphql_example.gitcd flutter_graphql_example
```### Server
```bash
cd ./servernpm install
npm run dev
```> Powered by [Koa-GraphQL](https://github.com/graphql-community/koa-graphql) & [LowDB](https://github.com/typicode/lowdb)
>
> Edit [todo.ts](./server/todo.ts) to use the content you like.As server gets ready, you can visit
- [http://localhost:4000/graphql](http://localhost:4000/graphql)
to check your **GraphQL Server** easily by [**GraphiQL**](https://github.com/graphql/graphiql), which contains definition of `Query` / `Mutation` info.
### Client
```bash
dart pub get
flutter run .\lib\main.dart
```> Powered by [graphql-flutter package](https://pub.dev/packages/graphql_flutter)