Config file reference
CLI reference
The CLI for the GraphQL SDK Generator only requires one parameter: the path to the configuration file. All other configurations are defined within the file passed to the CLI.
File Config
The following are the available options that can be included in the config.json
file:
Each option allows for customization, making the generated SDK more tailored to your needs. Simply adjust the values in the config.json
file to fit your project.
url
string
-
The GraphQL endpoint URL from which the schema will be fetched. This option is required.
sdkName
string
-
Custom name for the SDK folder where the generated code will be stored. This option is required.
fileType
string
-
The file type for the generated SDK. Options are 'ts' for TypeScript or 'js' for JavaScript. This option is required.
debug
boolean
false
Enables debugging, providing detailed logs for each step of the generation process.
baseDirectory
string
./
Specifies the base path where the SDK files and folders will be generated.
directoryName
string
graphqlSDKGenerator
Custom name for the directory where the SDK files will be generated.
depth
integer
2
Defines the depth level for generating nested GraphQL documents.
toGenerateSchemaFile
boolean
false
Determines whether to retain .graphql
files. These are not needed by the generated code.
headers
object
{}
Custom headers to be included when fetching the schema from the GraphQL endpoint.
Last updated