contribution_calendar
Creates, updates, deletes, gets or lists a contribution_calendar resource.
Overview
| Name | contribution_calendar |
| Type | Resource |
| Id | github.users.contribution_calendar |
Fields
The following fields are returned by SELECT queries:
- list
Response
| Name | Datatype | Description |
|---|---|---|
contribution_days | array | Daily entries for the week: date, weekday (0 = Sunday), contribution_count, color. |
first_day | string (date) | The date of the first day (Sunday) of the week. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | username | from, to | A user's contribution calendar (the profile contribution graph), one row per week with the daily counts as a JSON array - expand with json_each. Defaults to the trailing year; pass from and to (ISO 8601 timestamps, at most one year apart) for another window. Backed by the GitHub GraphQL API (user.contributionsCollection.contributionCalendar). |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
username | string | The handle for the GitHub user account. |
from | string (date-time) | Only contributions made at this time or later will be counted. ISO 8601, e.g. 2025-01-01T00:00:00Z. |
to | string (date-time) | Only contributions made before and up to this time will be counted. ISO 8601. |
SELECT examples
- list
A user's contribution calendar (the profile contribution graph), one row per week with the daily counts as a JSON array - expand with json_each. Defaults to the trailing year; pass from and to (ISO 8601 timestamps, at most one year apart) for another window. Backed by the GitHub GraphQL API (user.contributionsCollection.contributionCalendar).
SELECT
contribution_days,
first_day
FROM github.users.contribution_calendar
WHERE username = '{{ username }}' -- required
AND from = '{{ from }}'
AND to = '{{ to }}'
;