Emitter usage
Emitter usage
Section titled “Emitter usage”- Via the command line
tsp compile . --emit=@typespec/graphql- Via the config
emit: - "@typespec/graphql"The config can be extended with options as follows:
emit: - "@typespec/graphql"options: "@typespec/graphql": option: valueEmitter options
Section titled “Emitter options”emitter-output-dir
Section titled “emitter-output-dir”Type: absolutePath
Defines the emitter output directory. Defaults to {output-dir}/@typespec/graphql
See Configuring output directory for more info
output-file
Section titled “output-file”Type: string
Name of the output file. Output file will interpolate the following values:
- schema-name: Name of the schema if multiple
Default: {schema-name}.graphql
Example Single schema
schema.graphql
Example Multiple schemas
Org1.Schema1.graphqlOrg1.Schema2.graphql
new-line
Section titled “new-line”Type: "crlf" | "lf"
Default: "lf"
Set the newLine character for emitting files.
omit-unreachable-types
Section titled “omit-unreachable-types”Type: boolean
Omit unreachable types. By default all types declared under the schema namespace will be included. With this flag on only types references in an operation will be emitted.