File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,7 @@ You can configure the output in various ways
243
243
* ` name in graphqlCodegen ` - Used as a module name in the ` Sangria ` code generator.
244
244
* ` graphqlCodegenJson ` - Generate JSON encoders/decoders with your graphql query. Default is ` JsonCodec.None ` .
245
245
Note that not all styles support JSON encoder/decoder generation.
246
+ * ` graphqlCodegenImports: Seq[String] ` - A list of additional that are included in every generated file
246
247
247
248
248
249
#### JSON support
@@ -263,6 +264,25 @@ In your `build.sbt` you can configure the JSON library with
263
264
graphqlCodegenJson := JsonCodec .Circe
264
265
```
265
266
267
+ #### Scalar types
268
+
269
+ The code generation doesn't know about your additional scalar types.
270
+ sbt-graphql provides a setting ` graphqlCodegenImports ` to add an import to every
271
+ generated query object.
272
+
273
+ Example:
274
+
275
+ ```
276
+ scalar ZoneDateTime
277
+ ```
278
+
279
+ which is represented as ` java.time.ZoneDateTime ` . Add this as an import
280
+
281
+ ``` sbt
282
+
283
+ graphqlCodegenImports += " java.time.ZoneDateTime"
284
+ ```
285
+
266
286
#### Codegen style Apollo
267
287
268
288
As the name suggests the output is similar to the one in apollo codegen.
You can’t perform that action at this time.
0 commit comments