You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,16 +125,33 @@ Each `SchemaMap` is configured this way:
125
125
| Option | Default value | Description |
126
126
| - | - | - |
127
127
| `output` | | Relative path to output the generated code. It should end with `.graphql.dart` or else the generator will need to generate one more file. |
128
-
| `schema` | | Relative path to the GraphQL schema. |
129
-
| `queries_glob` | | Glob that selects all query files to be used with this schema. |
130
-
| `naming_scheme` | `pathedWithTypes` | The naming scheme to be used on generated classes names. `pathedWithTypes` is the default for retrocompatibility, where the names of previous types are used as prefix of the next class. This can generate duplication on certain schemas. With `pathedWithFields`, the names of previous fields are used as prefix of the next class and with `simple`, only the actual GraphQL class nameis considered. |
131
-
| `type_name_field` | `__typename` | The name of the field used to differentiate interfaces and union types (commonly `__typename` or `__resolveType`). Note that `__typename` field are not added automatically to the query. If you want interface/union type resolution, you need to manually add it there or set `append_type_name` to `true`. |
128
+
| `schema` | | Relative path to the GraphQL schema. | | `queries_glob` | | Glob that selects all query files to be used
129
+
with this schema. | | `naming_scheme` | `pathedWithTypes` | The naming scheme to be used on generated classes
130
+
names. `pathedWithTypes` is the default for retrocompatibility, where the names of previous types are used as prefix of
131
+
the next class. This can generate duplication on certain schemas. With `pathedWithFields`, the names of previous fields
132
+
are used as prefix of the next class and with `simple`, only the actual GraphQL class nameis considered. |
133
+
| `type_name_field` | `__typename` | The name of the field used to differentiate interfaces and union types (
134
+
commonly `__typename` or `__resolveType`). Note that `__typename` field are not added automatically to the query. If you
135
+
want interface/union type resolution, you need to manually add it there or set `append_type_name` to `true`. |
132
136
| `append_type_name` | `false` | Appends `type_name_field` value to the query selections set. |
133
137
134
138
See [examples](./example) for more information and configuration options.
135
139
136
140
### **Custom scalars**
137
-
If your schema uses custom scalars, they must be defined on `build.yaml`. If it needs a custom parser (to decode from/to json), the `custom_parser_import` path must be set and the file must implement both `fromGraphQL___ToDart___` and `fromDart___toGraphQL___` constant functions.
141
+
142
+
If your schema uses custom scalars, they must be defined on `build.yaml`. If it needs a custom parser (to decode from/to
143
+
json), the `custom_parser_import` path must be set and the file must implement both `fromGraphQL___ToDart___`
144
+
and `fromDart___toGraphQL___` constant functions.
145
+
`___ToDart___`and `___toGraphQL___` should be named including nullability, here is an example
0 commit comments