# Schema

## Schema

The Schema page provides an overview of your GraphQL schema, allowing you to filter and explore type and field definitions. Here, you can also view the raw Schema Definition Language (SDL) of your GraphQL schema. The page lists various kinds of definitions, including objects, scalars, inputs, etc.

### Query

The Query type is a crucial part of the GraphQL schema, serving as the entry point for every GraphQL query. While the Query type is a special type, it functions similarly to any other GraphQL object type, and its fields operate in the same way.

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/88BjFvc1W3QeHpddLsum/image.png" alt=""><figcaption><p>Query page</p></figcaption></figure>

GraphQL queries can go beyond simple types and traverse related objects and their fields. This ability enables clients to fetch comprehensive sets of related data in a single request, eliminating the need for multiple roundtrips as required in traditional REST architectures.

#### **Query Fields**&#x20;

1. **`getTenantFlowsExecuted :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>
   * **Description**: Retrieve executed flows for a specific tenant.
   * **Details**:&#x20;
     * tenant\_id <mark style="color:blue;">String</mark>!
2. **`healthCheck :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>&#x20;
   * **Description**: Performs a health check to verify the status and responsiveness of the system.&#x20;

***

### Mutation

The Mutation type in GraphQL is specifically designed to modify server-side data. Similar to queries, mutation fields can return an object type, allowing clients to request nested fields. Mutations can consist of multiple fields. However, a crucial distinction exists: while query fields execute in parallel, mutation fields run in series. This ensures that if multiple mutations are sent in a single request, the first mutation completes before the second begins, preventing race conditions.

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/YDZwaHo8fqeYsSNylq7T/image.png" alt=""><figcaption><p>Mutation page</p></figcaption></figure>

#### **Mutution Fields**&#x20;

1. **`cancelFlowExecution :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>
   * **Description**: Cancel the execution of a flow for a specific tenant and batch date time.
   * **Details**:&#x20;
     * tenantId <mark style="color:blue;">String</mark>!
     * executionBatchDateTime <mark style="color:blue;">String</mark>!
2. **`createCronJob :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>
   * **Description**: Schedule a cron job for a specific tenant.
   * **Details**:&#x20;
     * tenantId <mark style="color:blue;">String</mark>!
     * flowId <mark style="color:blue;">String</mark>!
     * uniqueId <mark style="color:blue;">String</mark>!
     * flowName <mark style="color:blue;">String</mark>!
     * dateStart <mark style="color:blue;">DateTime</mark>
     * dateEnd <mark style="color:blue;">DateTime</mark>
3. **`cronJobAction :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>
   * **Description**: Perform an action related to a scheduled cron job
   * **Details**:&#x20;
     * tenantId <mark style="color:blue;">String</mark>!
     * flowId <mark style="color:blue;">String</mark>!
     * flowName <mark style="color:blue;">String</mark>!
     * dateStart <mark style="color:blue;">DateTime</mark>
     * dateEnd <mark style="color:blue;">DateTime</mark>
4. **`deleteCronJob :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>
   * **Description**: Delete a scheduled cron job for a tenant.
   * **Details**:&#x20;
     * tenantId <mark style="color:blue;">String</mark>!
     * flowId <mark style="color:blue;">String</mark>!
     * id <mark style="color:blue;">String</mark>!
5. **`executeFlow :`` `**<mark style="color:blue;">**`ResultMessage`**</mark>&#x20;
   * **Description**: Execute a flow for a specific tenant.
   * **Details**:&#x20;
     * tenantId <mark style="color:blue;">String</mark>!
     * input <mark style="color:blue;">FlowInput</mark>

***

### Objects

The most basic components of a GraphQL schema are object types, representing distinct kinds of objects that can be fetched from the service, along with their defined fields.

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/4mLNkmo2IFUTqo2jkP5D/image.png" alt=""><figcaption><p>Object types page</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/txUoAE9xQDSrWsP16kGQ/image.png" alt=""><figcaption><p>ResultMessage Details</p></figcaption></figure>

#### Object Type: <mark style="color:blue;">**`ResultMessage`**</mark>

* **Description**: Results of the operation.

**Fields**

1. **`isSuccessful :`` `**<mark style="color:blue;">**`Boolean`**</mark>
   * **Description:** A boolean field indicating whether the operation was successful.
2. **`message :`` `**<mark style="color:blue;">**`String`**</mark>
   * **Description:** A string field providing additional information or messages related to the operation.
3. **`resultObject :`` `**<mark style="color:blue;">**`JSON`**</mark>
   * **Description:** A field containing a JSON object representing additional result data. The structure of this object may vary based on the context of the operation.

**Used By Types**

1. <mark style="color:blue;">**`Query.healthCheck`**</mark>
   * **Description:** Health check endpoint to verify service status.
2. <mark style="color:blue;">**`Query.getTenantFlowsExecuted`**</mark>
   * **Description:** Retrieve executed flows for a specific tenant.
3. <mark style="color:blue;">**`Mutation.executeFlow`**</mark>
   * **Description:** Execute a flow for a specific tenant.
4. <mark style="color:blue;">**`Mutation.cronJobAction`**</mark>
   * **Description:** Perform an action related to a scheduled cron job.
5. <mark style="color:blue;">**`Mutation.createCronJob`**</mark>
   * **Description:** Schedule a cron job for a specific tenant.
6. <mark style="color:blue;">**`Mutation.deleteCronJob`**</mark>
   * **Description:** Delete a scheduled cron job for a tenant.
7. <mark style="color:blue;">**`Mutation.cancelFlowExecution`**</mark>
   * **Description:** Cancel the execution of a flow for a specific tenant and batch date time

***

### Scalars

Scalar types in GraphQL represent the leaves of a query, providing a way to represent concrete data. Below are descriptions for each scalar type in the GraphQL schema.

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/4qrmuTvsoxXqunz69iTg/image.png" alt=""><figcaption><p>Scalars page</p></figcaption></figure>

#### Scalar Types

1.  <mark style="color:blue;">**`Boolean`**</mark>&#x20;

    * **Description**: The Boolean scalar type represents true or false. It is commonly used for logical operations and conditions within GraphQL queries.

    <figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/GnbmNm0Vx8MtcMjGRY36/image.png" alt=""><figcaption></figcaption></figure>

    Used By Types

    * <mark style="color:blue;">**`ResultMessage.isSuccessful`**</mark>
      * **Description**: The Boolean scalar type is used by the isSuccessful field of the ResultMessage object type to indicate the success status of an operation.\

2.  <mark style="color:blue;">**`DateTime`**</mark>&#x20;

    * **Description**: A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the date-time format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.

    <figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/2W6AWp43UBj7T36xqkNn/image.png" alt=""><figcaption></figcaption></figure>

    Used By Types

    * <mark style="color:blue;">**`Mutation.cronJobAction(dateStart)`**</mark>
      * **Description**: Perform an action related to a scheduled cron job.
    * <mark style="color:blue;">**`Mutation.cronJobAction(dateEnd)`**</mark>
      * **Description**: Perform an action related to a scheduled cron job.
    * <mark style="color:blue;">**`Mutation.createCronJob(dateStart)`**</mark>
      * **Description**: Schedule a cron job for a specific tenant.
    * <mark style="color:blue;">**`Mutation.createCronJob(dateEnd)`**</mark>
      * **Description**: Schedule a cron job for a specific tenant\

3.  <mark style="color:blue;">**`JSON`**</mark>&#x20;

    * **Description**: The JSON scalar type represents JSON values as specified by ECMA-404.

    <div align="left" data-full-width="true"><figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/Weyh1VLkwPtFre3qTKyh/image.png" alt=""><figcaption></figcaption></figure></div>

    Used By Types

    * <mark style="color:blue;">**`ResultMessage.resultObject`**</mark>&#x20;
      * **Description**: The JSON scalar type is used by the resultObject field of the ResultMessage object type to convey additional data or results.&#x20;
    * <mark style="color:blue;">**`FlowInput.payload`**</mark>&#x20;
      * **Description**: The JSON scalar type is used by the payload field of the FlowInput input type to provide a flexible and structured input for a flow execution.\

4.  <mark style="color:blue;">**`String`**</mark>

    * **Description**: The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

    <figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/Xj7Zq6NQ89BjT2WHVmyN/image.png" alt=""><figcaption></figcaption></figure>

    Used By Types

    * <mark style="color:blue;">**`Query.getTenantFlowsExecuted(tenant_id)`**</mark>
      * **Description**: Retrieve executed flows for a specific tenant.
    * <mark style="color:blue;">**`Mutation.executeFlow(tenantId)`**</mark>
      * **Description**: Execute a flow for a specific tenant.
    * <mark style="color:blue;">**`Mutation.cronJobAction(tenantId)`**</mark>
      * **Description**: Perform an action related to a scheduled cron job.
    * <mark style="color:blue;">**`Mutation.cronJobAction(flowId)`**</mark>
      * **Description**: Perform an action related to a scheduled cron job.
    * <mark style="color:blue;">**`Mutation.cronJobAction(flowName)`**</mark>
      * **Description**: Perform an action related to a scheduled cron job.
    * <mark style="color:blue;">**`Mutation.createCronJob(tenantId)`**</mark>
      * **Description**: Schedule a cron job for a specific tenant.
    * <mark style="color:blue;">**`Mutation.createCronJob(flowId)`**</mark>
      * **Description**: Schedule a cron job for a specific tenant.
    * <mark style="color:blue;">**`Mutation.createCronJob(uniqueId)`**</mark>
      * **Description**: Schedule a cron job for a specific tenant.
    * <mark style="color:blue;">**`Mutation.createCronJob(flowName)`**</mark>
      * **Description**: Schedule a cron job for a specific tenant.
    * <mark style="color:blue;">**`Mutation.deleteCronJob(tenantId)`**</mark>
      * **Description**: Delete a scheduled cron job for a tenant.
    * <mark style="color:blue;">**`Mutation.deleteCronJob(flowId)`**</mark>
      * **Description**: Delete a scheduled cron job for a tenant.
    * <mark style="color:blue;">**`Mutation.deleteCronJob(id)`**</mark>
      * **Description**: Delete a scheduled cron job for a tenant.
    * <mark style="color:blue;">**`Mutation.cancelFlowExecution(tenantId)`**</mark>
      * **Description**: Cancel the execution of a flow for a specific tenant and batch date time.
    * <mark style="color:blue;">**`Mutation.cancelFlowExecution(executionBatchDateTime)`**</mark>
      * **Description**: Cancel the execution of a flow for a specific tenant and batch date time.
    * <mark style="color:blue;">**`ResultMessage.message`**</mark>
      * **Description**: No description.
    * <mark style="color:blue;">**`FlowInput.flow_id`**</mark>
      * **Description**: No description

***

### Input

Input types in GraphQL allow the passing of complex objects as arguments into a field, particularly useful for mutations where entire objects need to be created. Below is the description for the input type present in the GraphQL schema.

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/bFsOrAjvwFCe1aS3JCSK/image.png" alt=""><figcaption><p>Input page</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/3tlDugFe6zM0q6mmf48A/image.png" alt=""><figcaption><p>FlowInput Input Types page</p></figcaption></figure>

#### Input Type: <mark style="color:blue;">`FlowInput`</mark>

* **Description**: The FlowInput input type is designed for passing complex data when executing a flow mutation. It encapsulates specific fields required to describe the input data for the flow execution.

Fields

1. **`flow_id :`` `**<mark style="color:blue;">**`String`**</mark>&#x20;
   * **Description**: The identifier for the flow associated with the input. Specifies which flow the mutation should act upon.&#x20;
2. **`payload :`` `**<mark style="color:blue;">**`JSON`**</mark>&#x20;
   * **Description**: A field representing the payload for the flow. It accepts data in JSON format, allowing for a flexible and structured input.&#x20;

Used By Types

1. <mark style="color:blue;">**`Mutation.executeFlow(input)`**</mark>&#x20;
   * **Description**: The FlowInput input type is utilized by the executeFlow mutation in the Mutation type. When executing a flow, this input type allows users to provide the necessary information, such as the flow identifier (flow\_id) and payload (payload), to perform the mutation.

***

### **Directives**

Directives in GraphQL allow you to modify the execution of queries in various ways. Below are descriptions for each directive present in the GraphQL schema.

<figure><img src="https://content.gitbook.com/content/1RGHbME32dCYp3EPTlfr/blobs/6ewNAiTkH6u90LVa5wWe/image.png" alt=""><figcaption><p>Directives page </p></figcaption></figure>

#### **Directives**

1. <mark style="color:blue;">**`@deprecated`**</mark>
   * **Description**: Marks an element of a GraphQL schema as no longer supported
   * **Details**:&#x20;
     * reason <mark style="color:blue;">**String**</mark> = "No longer supported"&#x20;
     * Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by CommonMark.
2. <mark style="color:blue;">**`@include`**</mark>
   * **Description**: Directs the executor to include this field or fragment only when the if argument is true.
   * **Details**:&#x20;
     * if <mark style="color:blue;">**Boolean**</mark>!&#x20;
     * Included when true.
3. <mark style="color:blue;">**`@skip`**</mark>
   * **Description**: Directs the executor to skip this field or fragment when the if argument is true.
   * **Details**:&#x20;
     * if <mark style="color:blue;">**Boolean**</mark>!&#x20;
     * Skipped when true..
4. <mark style="color:blue;">**`@specifiedBy`**</mark>
   * **Description**: Exposes a URL that specifies the behaviour of this scalar.
   * **Details**:&#x20;
     * url <mark style="color:blue;">**String**</mark>!&#x20;
     * The URL that specifies the behaviour of this scalar.
