Skip to content

Commit

Permalink
Update docs for excludeDeprecated (ghostdogpr#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeejeeone authored and XiNiHa committed May 11, 2024
1 parent 9fc5f28 commit 9a0adb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vuepress/docs/docs/client-codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ The settings available on the `cs` (`CalibanSettings`) builder are:
- `enableFmt`: Enable code formatting with scalafmt (default: `true`).
- `extensibleEnums`: Generate a fallback case class for unknown enum values (default: `false`).
- `headers` (only defined for `url` settings): Supply extra headers when fetching the schema from a URL.
- `excludeDeprecated`: Exclude fields and enum values with deprecated directive (default: `false`).

### Manual generation

If you prefer to generate the client explicitly rather than automatically, you can use `calibanGenClient` on the SBT CLI as follows:

```bash
calibanGenClient schemaPath outputPath [--scalafmtPath path] [--headers name:value,name2:value2] [--genView true|false] [--scalarMappings gqlType:f.q.d.n.Type,gqlType2:f.q.d.n.Type2] [--imports a.b.c._,c.d.E] [--splitFiles true|false] [--enableFmt true|false]
calibanGenClient schemaPath outputPath [--scalafmtPath path] [--headers name:value,name2:value2] [--genView true|false] [--scalarMappings gqlType:f.q.d.n.Type,gqlType2:f.q.d.n.Type2] [--imports a.b.c._,c.d.E] [--splitFiles true|false] [--enableFmt true|false] [--extensibleEnums true|false] [--excludeDeprecated true|false]

# example
calibanGenClient project/schema.graphql src/main/client/Client.scala --genView true
Expand Down Expand Up @@ -172,6 +173,7 @@ This `ClientGenerationSettings` case class gives you the following configuration
- `splitFiles`: Whether to split the generated code into multiple files (default: `false`).
- `enableFmt`: Enable code formatting with scalafmt (default: `true`).
- `extensibleEnums`: Generate a fallback case class for unknown enum values (default: `false`).
- `excludeDeprecated`: Exclude fields or enum values with deprecated directive (default: `false`).

Let's take an example:
```scala
Expand Down

0 comments on commit 9a0adb6

Please sign in to comment.