package codegen
- Alphabetic
- By Inheritance
- codegen
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
ApolloSourceGenerator(fileName: String, additionalImports: List[Import], additionalInits: List[Init], jsonCodeGen: JsonCodeGen) extends Generator[List[Stat]] with Product with Serializable
Generate code using Scalameta.
-
case class
CodeGenContext(schema: Schema[Any, Any], targetDirectory: File, graphQLFiles: Seq[File], packageName: String, moduleName: String, jsonCodeGen: JsonCodeGen, imports: Seq[String], preProcessors: Seq[PreProcessor], log: sbt.Logger) extends Product with Serializable
Initial context to kickoff code generation.
CodeGen Context
Initial context to kickoff code generation.
- schema
the graphql schema
- targetDirectory
the target directory where the source code will be placed
- graphQLFiles
input files that should be processed
- packageName
the scala package name
- moduleName
optional module name for single-file based generators
- imports
list of imports to be added to the generated file
- preProcessors
pre processors that should be applied before the graphql file is parsed
- log
output log
-
case class
Failure(message: String) extends Exception with Product with Serializable
A generic error type for codegen failures.
-
trait
Generator[T] extends (Api) ⇒ Result[T]
Generate a result from the loaded tree.
-
trait
JsonCodeGen extends AnyRef
JsonCodeGen
-
type
PreProcessor = (String) ⇒ Result[String]
Type alias for a graphql file pre-processing function.
Type alias for a graphql file pre-processing function. _ The input is the raw graphql file content _ The output is the transformed graphql file content or an error
-
type
Result[T] = Either[Failure, T]
Type alias for a processing result during a code generation step
-
case class
ScalametaGenerator(moduleName: Name, emitInterfaces: Boolean = false, stats: List[Stat] = List.empty) extends Generator[Object] with Product with Serializable
Generate code using Scalameta.
-
sealed
trait
TypedDocument extends AnyRef
AST representing the extracted GraphQL types.
- case class TypedDocumentParser(schema: Schema[_, _], document: Document) extends Product with Serializable
Value Members
-
object
CodeGenStyles
Object that contains different code generation styles
CodeGen Styles
Object that contains different code generation styles
- object DocumentLoader
- object Failure extends Serializable
-
object
GraphQLQueryGenerator
Provides a
GraphQLQuerytrait.Provides a
GraphQLQuerytrait. This is heavily inspired by the apollo scalajs code generator.trait GraphQLQuery { // the input variables type Variables // the returned data type Data // the document that should be executed val document: sangria.ast.Document }
- object JsonCodeGens
- object PreProcessors
- object ScalametaGenerator extends Serializable
-
object
ScalametaUtils
More robust way to parse Type.Ref and Term.Ref from String.
More robust way to parse Type.Ref and Term.Ref from String.
- See also
More discussion: https://gitter.im/scalameta/scalameta?at=5b9ba14f8909f71f75d1b4bd
https://astexplorer.net/#/gist/ec56167ffafb20cbd8d68f24a37043a9/677e43f3adb93db8513dbe4e2c868dd4f78df4b3
-
object
SourceCodeWriter
Writes scalameta ASTs to scala source files.
Source Code Writer
Writes scalameta ASTs to scala source files.
- object TypedDocument