From 03f78a06e097e6a14f399dc70b44c5947d22b5a5 Mon Sep 17 00:00:00 2001 From: lWarne Date: Mon, 5 Jul 2021 19:31:39 +0100 Subject: [PATCH] Add documentation around abstractEffectType option Add to documentation in schema.md around usage of the --abstractEffectType option. --- codegen-sbt/src/main/scala/caliban/codegen/CalibanCli.scala | 2 +- vuepress/docs/docs/schema.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codegen-sbt/src/main/scala/caliban/codegen/CalibanCli.scala b/codegen-sbt/src/main/scala/caliban/codegen/CalibanCli.scala index 5d2829f05..e16e6f43e 100644 --- a/codegen-sbt/src/main/scala/caliban/codegen/CalibanCli.scala +++ b/codegen-sbt/src/main/scala/caliban/codegen/CalibanCli.scala @@ -51,7 +51,7 @@ object CalibanCli { private val genSchemaHelpMsg = s""" - |calibanGenSchema schemaPath outputPath [--scalafmtPath path] [--headers name:value,name2:value2] [--packageName name] [--effect fqdn.Effect] [--abstractEffectType] + |calibanGenSchema schemaPath outputPath [--scalafmtPath path] [--headers name:value,name2:value2] [--packageName name] [--effect fqdn.Effect] [--abstractEffectType true|false] | |This command will create a Scala file in `outputPath` containing all the types |defined in the provided GraphQL schema defined at `schemaPath`. Instead of a path, diff --git a/vuepress/docs/docs/schema.md b/vuepress/docs/docs/schema.md index 5ed89d8ca..22ba1da05 100644 --- a/vuepress/docs/docs/schema.md +++ b/vuepress/docs/docs/schema.md @@ -234,7 +234,7 @@ enablePlugins(CalibanPlugin) Then call the `calibanGenSchema` sbt command. ```scala -calibanGenSchema schemaPath outputPath [--scalafmtPath path] [--headers name:value,name2:value2] [--packageName name] [--effect fqdn.Effect] [--scalarMappings gqlType:f.q.d.n.Type,gqlType2:f.q.d.n.Type2] [--imports a.b.c._,c.d.E] +calibanGenSchema schemaPath outputPath [--scalafmtPath path] [--headers name:value,name2:value2] [--packageName name] [--effect fqdn.Effect] [--scalarMappings gqlType:f.q.d.n.Type,gqlType2:f.q.d.n.Type2] [--imports a.b.c._,c.d.E] [--abstractEffectType true|false] calibanGenSchema project/schema.graphql src/main/MyAPI.scala ``` @@ -244,7 +244,7 @@ The generated code will be formatted with Scalafmt using the configuration defin The package of the generated code is derived from the folder of `outputPath`. This can be overridden by providing an alternative package with the `--packageName` option. -By default, each Query and Mutation will be wrapped into a `zio.UIO` effect. This can be overridden by providing an alternative effect with the `--effect` option. +By default, each Query and Mutation will be wrapped into a `zio.UIO` effect. This can be overridden by providing an alternative effect with the `--effect` option. You can also indicate that the value passed to the `--effect` option is in abstract type via `--abstractEffectType true`, in which case `Query` will be replaced by `Query[F[_]]` and so on (if `--effect F` is used). If you want to force a mapping between a GraphQL type and a Scala class (such as scalars), you can use the `--scalarMappings` option. Also you can add additional imports by providing `--imports` option.