Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for excludeDeprecated #2171

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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