Skip to content

Commit 9341d9b

Browse files
committed
updated README
1 parent de8de7f commit 9341d9b

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# graphql-codegen-flutter-artemis-hooks
22

3-
this is graphql-codegen plugin to generate Flutter artemis hooks.
3+
This is graphql-codegen plugin to generate type-safe, easy-to use Flutter artemis hooks.
4+
For further detail, see "What it generates" section.
5+
6+
## Prerequisite
7+
8+
This plugin assumes that you use the following packages
9+
10+
- [flutter_hooks](https://pub.dev/packages/flutter_hooks)
11+
- [graphql_flutter](https://pub.dev/packages/graphql_flutter)
12+
- [artemis](https://pub.dev/packages/artemis)
413

514
## How to use
615

@@ -12,20 +21,20 @@ npm i graphql-codegen-flutter-artemis-hooks
1221

1322
### Edit codegen.yml
1423

15-
you need to specify path for generated file by artemis
24+
Please specify path to the file generated by artemis
1625

1726
```yml
1827
schema: your_schema_file.graphql
1928
documents: './your_project/**/*.graphql'
2029
generates:
21-
test/output.dart:
30+
your_project/generated_hooks.dart:
2231
config:
2332
artemisImportPath: package:your_project/your_artemis_generated/graphql_api.dart
2433
plugins:
2534
- graphql-codegen-flutter-artemis-hooks
2635
```
2736
28-
then run the plugin!!
37+
then run the codegens!!
2938
3039
## What it generates
3140
@@ -95,7 +104,7 @@ ExampleQuery$QueryReturnType useExampleQueryQuery<DataType>(BuildContext context
95104
return ExampleQuery$QueryReturnType(result.isLoading, result.exception, result.data == null ? null : ExampleQuery$Query.fromJson(result.data!));
96105
}
97106
98-
class TestMutation$MutationReturnType {
107+
class TestMutation$MutationReturnType {
99108
bool isLoading;
100109
OperationException? exception;
101110
TestMutation$Mutation? data;
@@ -109,7 +118,7 @@ TestMutation$MutationReturnType useTestMutationQuery<DataType>(BuildContext cont
109118
}
110119
```
111120

112-
Then you can use the generated type-safe hooks as following
121+
Then you can use the generated type-safe hooks as following.
113122

114123
```dart
115124
class PageWidget extends HookWidget {
@@ -125,14 +134,6 @@ class PageWidget extends HookWidget {
125134
}
126135
```
127136

128-
## Prerequisite
129-
130-
This project is assumes you would use the following packages
131-
132-
- [flutter_hooks](https://pub.dev/packages/flutter_hooks)
133-
- [graphql_flutter](https://pub.dev/packages/graphql_flutter)
134-
- [artemis](https://pub.dev/packages/artemis)
135-
136137
## Configuration
137138

138139
- `artemisImportPath`: path to your generated file by artemis

0 commit comments

Comments
 (0)