{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "IsographProjectConfig",
  "description": "This struct is deserialized from an isograph.config.json file.",
  "type": "object",
  "required": [
    "project_root",
    "schema"
  ],
  "properties": {
    "$schema": {
      "description": "The user may hard-code the JSON Schema for their version of the config.",
      "type": [
        "string",
        "null"
      ]
    },
    "artifact_directory": {
      "description": "The relative path to the folder where the compiler should create artifacts Defaults to the project_root directory.",
      "type": [
        "string",
        "null"
      ]
    },
    "options": {
      "description": "Various options of less importance",
      "allOf": [
        {
          "$ref": "#/definitions/ConfigFileOptions"
        }
      ]
    },
    "project_root": {
      "description": "The relative path to the folder where the compiler should look for Isograph literals",
      "type": "string"
    },
    "schema": {
      "description": "The relative path to the GraphQL schema",
      "type": "string"
    },
    "schema_extensions": {
      "description": "The relative path to schema extensions",
      "default": [],
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "definitions": {
    "ConfigFileJavascriptModule": {
      "type": "string",
      "enum": [
        "commonjs",
        "esmodule"
      ]
    },
    "ConfigFileOpenTelemetryOptions": {
      "type": "object",
      "properties": {
        "collector_endpoint": {
          "description": "OTLP collector endpoint (e.g., http://localhost:4317)",
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "enable_tracing": {
          "description": "Enable sending traces to a collector",
          "default": false,
          "type": "boolean"
        },
        "service_name": {
          "description": "Service name for traces",
          "default": null,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "ConfigFileOptionalValidationLevel": {
      "oneOf": [
        {
          "description": "If this validation error is encountered, it will be ignored",
          "type": "string",
          "enum": [
            "ignore"
          ]
        },
        {
          "description": "If this validation error is encountered, a warning will be issued",
          "type": "string",
          "enum": [
            "warn"
          ]
        },
        {
          "description": "If this validation error is encountered, the compilation will fail",
          "type": "string",
          "enum": [
            "error"
          ]
        }
      ]
    },
    "ConfigFileOptions": {
      "type": "object",
      "properties": {
        "generated_file_header": {
          "description": "A string to generate, in a comment, at the top of every generated file.",
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "include_file_extensions_in_import_statements": {
          "description": "Should the compiler include file extensions in import statements in generated files? e.g. should it import ./param_type or ./param_type.ts?",
          "default": false,
          "type": "boolean"
        },
        "module": {
          "description": "The babel plugin transforms isograph literals containing entrypoints into imports or requires of the generated entrypoint.ts file. Should it generate require calls or esmodule imports?",
          "allOf": [
            {
              "$ref": "#/definitions/ConfigFileJavascriptModule"
            }
          ]
        },
        "no_babel_transform": {
          "description": "Set this to true if you don't have the babel transform enabled.",
          "default": false,
          "type": "boolean"
        },
        "on_invalid_id_type": {
          "description": "What the compiler should do if it encounters an id field whose type is not ID! or ID.",
          "allOf": [
            {
              "$ref": "#/definitions/ConfigFileOptionalValidationLevel"
            }
          ]
        },
        "open_telemetry": {
          "description": "OpenTelemetry tracing configuration",
          "anyOf": [
            {
              "$ref": "#/definitions/ConfigFileOpenTelemetryOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "persisted_documents": {
          "description": "Persisted documents options",
          "anyOf": [
            {
              "$ref": "#/definitions/ConfigFilePersistedDocumentsOptions"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ConfigFilePersistedDocumentsHashAlgorithm": {
      "type": "string",
      "enum": [
        "md5",
        "sha256"
      ]
    },
    "ConfigFilePersistedDocumentsOptions": {
      "type": "object",
      "properties": {
        "algorithm": {
          "description": "The hashing algorithm used to compute document hashes.",
          "allOf": [
            {
              "$ref": "#/definitions/ConfigFilePersistedDocumentsHashAlgorithm"
            }
          ]
        },
        "file": {
          "description": "The file name for the persisted documents Defaults to `persisted_documents.json`",
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "include_extra_info": {
          "description": "Include extra info to the operation text",
          "default": false,
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  }
}