Skip to content

Commit

Permalink
Document additional imports setting
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Aug 5, 2018
1 parent 225fde2 commit 10d2e5d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ You can configure the output in various ways
* `name in graphqlCodegen` - Used as a module name in the `Sangria` code generator.
* `graphqlCodegenJson` - Generate JSON encoders/decoders with your graphql query. Default is `JsonCodec.None`.
Note that not all styles support JSON encoder/decoder generation.
* `graphqlCodegenImports: Seq[String]` - A list of additional that are included in every generated file


#### JSON support
Expand All @@ -263,6 +264,25 @@ In your `build.sbt` you can configure the JSON library with
graphqlCodegenJson := JsonCodec.Circe
```

#### Scalar types

The code generation doesn't know about your additional scalar types.
sbt-graphql provides a setting `graphqlCodegenImports` to add an import to every
generated query object.

Example:

```
scalar ZoneDateTime
```

which is represented as `java.time.ZoneDateTime`. Add this as an import

```sbt

graphqlCodegenImports += "java.time.ZoneDateTime"
```

#### Codegen style Apollo

As the name suggests the output is similar to the one in apollo codegen.
Expand Down

0 comments on commit 10d2e5d

Please sign in to comment.