# 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.

```bash
graphql-sdk-generator -c config.json 
```

### File Config

The following are the available options that can be included in the `config.json` file:

{% code lineNumbers="true" %}

```json
{
  "url": "https://your-end-point",
  "sdkName": "custom-sdk-name",
  "fileType": "ts",
  "debug": true, 
  "baseDirectory": "custom-directory-path-name",
  "directoryName": "custom-name",
  "depth": 2,
  "toGenerateSchemaFile": false,
  "headers": {
    "x-api-key": "api-key",
    ...more headers
  }
  
}

```

{% endcode %}

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.

|         Name         |   Type  |       Default       |                                                      Description                                                      |
| :------------------: | :-----: | :-----------------: | :-------------------------------------------------------------------------------------------------------------------: |
|          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.                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.siddharth9890.com/graphql-sdk-generator/config-file-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
