Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flutterando/shelf_hasura_actions
Shelf Middleware for Hasura Action.
https://github.com/flutterando/shelf_hasura_actions
Last synced: 3 days ago
JSON representation
Shelf Middleware for Hasura Action.
- Host: GitHub
- URL: https://github.com/flutterando/shelf_hasura_actions
- Owner: Flutterando
- License: mit
- Created: 2021-03-04T18:28:07.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-05T23:41:04.000Z (almost 4 years ago)
- Last Synced: 2025-01-08T19:54:55.724Z (16 days ago)
- Language: Dart
- Homepage: https://pub.dev/packages/shelf_hasura_actions
- Size: 13.7 KB
- Stars: 4
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# shelf_hasura_actions
Shelf Middleware for Hasura Action. See [Hasura Action Doc](https://hasura.io/docs/latest/graphql/core/actions/index.html)
## Usage Action
A simple usage example :
```dart
import 'package:shelf_hasura_actions/shelf_hasura_actions.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'calculate_usebmi_function.dart' as bmi;void main() async {
//get handler
final hasuraHandler = hasuraActions(_actions);// just put in shelf pipeline
var server = await io.serve(hasuraHandler, 'localhost', 8080);
print('Serving at http://${server.address.host}:${server.port}');
}//my actions list
const _actions = {
'bmiAction': bmi.calculateUseBmi,
};
```## Action Function example:
```dart
import 'package:shelf_hasura_actions/src/hasura_request.dart';
import 'package:shelf/shelf.dart';Future calculateUseBmi(ActionRequest action) async {
return Response.ok('result": ok');
}
```## Usage Trigger
A simple usage example :
```dart
import 'package:shelf_hasura_actions/shelf_hasura_actions.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'calculate_usebmi_function.dart' as bmi;void main() async {
//get handler
final hasuraHandler = hasuraTrigger(_actions);// just put in shelf pipeline
var server = await io.serve(hasuraHandler, 'localhost', 8080);
print('Serving at http://${server.address.host}:${server.port}');
}//my actions list
const _actions = {
'bmiAction': bmi.calculateUseBmi,
};
```## Trigger Function example:
```dart
import 'package:shelf_hasura_actions/src/hasura_request.dart';
import 'package:shelf/shelf.dart';Future calculateUseBmi(TriggerRequest action) async {
return Response.ok('result": ok');
}
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].