# sourceSchedules

```graphql
query SourceSchedules($projectReference: String!) {
  sourceSchedules(projectReference: $projectReference) {
    data {
      id
      name
      description
      schedule
      timezone
      runtimeTargetKind
      runtimeTargetEnvironmentId
      runtimeTargetBranchId
      config
      timeoutSeconds
      backoffLimit
      concurrencyPolicy
      maxRuns
      health
      definitionSource
      sourceTriggerId
      sourcePath
      sourceHash
      editMode
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    diagnostics {
      kind
      sourceKind
      sourcePath
      sourceId
      code
      message
      details
    }
  }
}
```

List the schedules declared in the source files of a project, a branch or an environment to see what can be activated; returns every declared schedule as one page with the discovery diagnostics. Requires project.runs.read.

## Arguments

| Name                        | Type                | Required | Description                                                                                                                    |
| --------------------------- | ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `projectReference`          | String!             | Yes      |                                                                                                                                |
| `input`                     | SourceSelectorInput |          |                                                                                                                                |
| `input.sourceTargetKind`    | SourceTargetKind    |          | The source to read; default runtimeTargetKind, else project. One of `project`, `main_branch`, `environment`, `preview_branch`. |
| `input.runtimeTargetKind`   | RuntimeTargetKind   |          | Used as the source to read when sourceTargetKind is omitted. One of `main_branch`, `environment`, `preview_branch`.            |
| `input.targetEnvironmentId` | ID                  |          | Required with the kind environment.                                                                                            |
| `input.targetBranchId`      | ID                  |          | Required with the kind preview\_branch.                                                                                        |

## Variables

```json
{
  "projectReference": "string"
}
```

## Responses

| Status | Description                                      |
| ------ | ------------------------------------------------ |
| 200    | The SourceScheduleList! in data.sourceSchedules. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query SourceSchedules($projectReference: String!) {\n  sourceSchedules(projectReference: $projectReference) {\n    data {\n      id\n      name\n      description\n      schedule\n      timezone\n      runtimeTargetKind\n      runtimeTargetEnvironmentId\n      runtimeTargetBranchId\n      config\n      timeoutSeconds\n      backoffLimit\n      concurrencyPolicy\n      maxRuns\n      health\n      definitionSource\n      sourceTriggerId\n      sourcePath\n      sourceHash\n      editMode\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n    diagnostics {\n      kind\n      sourceKind\n      sourcePath\n      sourceId\n      code\n      message\n      details\n    }\n  }\n}",
  "variables": {
    "projectReference": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "sourceSchedules": {
      "data": [
        {
          "id": "string",
          "name": "string",
          "description": "string",
          "schedule": "string",
          "timezone": "string",
          "runtimeTargetKind": "main_branch",
          "runtimeTargetEnvironmentId": "string",
          "runtimeTargetBranchId": "string",
          "config": {},
          "timeoutSeconds": 0,
          "backoffLimit": 0,
          "concurrencyPolicy": "allow",
          "maxRuns": 0,
          "health": {},
          "definitionSource": "manual",
          "sourceTriggerId": "string",
          "sourcePath": "string",
          "sourceHash": "string",
          "editMode": "structured"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      },
      "diagnostics": [
        {
          "kind": "string",
          "sourceKind": "string",
          "sourcePath": "string",
          "sourceId": "string",
          "code": "string",
          "message": "string",
          "details": {}
        }
      ]
    }
  }
}
```
