Skip to main content

project_favorites

Creates, updates, deletes, gets or lists a project_favorites resource.

Overview​

Nameproject_favorites
TypeResource
Idrailway.projects.project_favorites

Fields​

The following fields are returned by SELECT queries:

One row per value, as the result column.

NameDatatypeDescription
resultstringprojectFavorites value

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectworkspace_idorder_byThe authenticated user's favorited project ids in a workspace, in the order the Favorites row should render them. Defaults to the order they were starred in. Backed by the Railway GraphQL query projectFavorites.
setexecfavorite, project_idStar or unstar a project for the authenticated user. Returns the resulting state. Backed by the Railway GraphQL mutation projectFavoriteSet.

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.

NameDatatypeDescription
workspace_idstring
order_bystring
favoritestringBoolean passed as a string, for example 'true'.
project_idstring

SELECT examples​

The authenticated user's favorited project ids in a workspace, in the order the Favorites row should render them. Defaults to the order they were starred in. Backed by the Railway GraphQL query projectFavorites.

SELECT
result
FROM railway.projects.project_favorites
WHERE workspace_id = '{{ workspace_id }}' -- required
AND order_by = '{{ order_by }}'
;

Lifecycle Methods​

Star or unstar a project for the authenticated user. Returns the resulting state. Backed by the Railway GraphQL mutation projectFavoriteSet.

EXEC railway.projects.project_favorites.set
@favorite='{{ favorite }}', --required
@project_id='{{ project_id }}' --required
;