user_profiles
Creates, updates, deletes, gets or lists a user_profiles resource.
Overview​
| Name | user_profiles |
| Type | Resource |
| Id | railway.account.user_profiles |
Fields​
The following fields are returned by SELECT queries:
- get
One UserProfileResponse row.
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
avatar | string | |
created_at | string (date-time) | |
profile | object | UserProfile object |
total_deploys | integer | |
username | string |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | username | Get the public profile for a user. Backed by the Railway GraphQL query userProfile. | |
update | update | is_public | Updates the profile for the authenticated user. Backed by the Railway GraphQL mutation userProfileUpdate. |
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 | |
is_public | boolean |
SELECT examples​
- get
Get the public profile for a user. Backed by the Railway GraphQL query userProfile.
SELECT
id,
name,
avatar,
created_at,
profile,
total_deploys,
username
FROM railway.account.user_profiles
WHERE username = '{{ username }}' -- required
;
UPDATE examples​
- update
Updates the profile for the authenticated user. Backed by the Railway GraphQL mutation userProfileUpdate.
UPDATE railway.account.user_profiles
SET
bio = '{{ bio }}',
website = '{{ website }}'
WHERE
is_public = '{{ is_public }}' --required
RETURNING
result;