Skip to content

Journal Entries

Journal Entries

You can learn more about the Journal feature in general on Healthie’s Help platform.

The Journal Entry Object

{
"id": "15",
"description": "Example entry",
"created_at": "2022-08-03 09:55:55 -0400",
"type": "FoodEntry",
"name": "Food",
"viewed": false,
"healthiness_info_hex_value": "#35b032",
"has_subentries": false,
"previous_water_intake_stat": 0,
"default_water_intake_for_entry_user": 0,
"poster": {
"id": "7"
}
}

Journal Entries are Entry objects.

You can view the full list of available fields here.

Listing Entries

query entries(
$offset: Int
$type: String
$keywords: String
$entry_id: String
$category: String
$client_id: String
$is_org: Boolean
$end_range: String
$start_range: String
$group_id: String
$sort_by: String
$end_datetime_range: String
$start_datetime_range: String
$summary_view: Boolean
) {
entries(
offset: $offset
type: $type
keywords: $keywords
entry_id: $entry_id
category: $category
client_id: $client_id
is_org: $is_org
end_range: $end_range
start_range: $start_range
group_id: $group_id
sort_by: $sort_by
end_datetime_range: $end_datetime_range
start_datetime_range: $start_datetime_range
summary_view: $summary_view
) {
id
type
added_by_user {
id
}
category
emotions
name
description
}
}

Listing Entries is done via the entries query.

You can view a full list of potential arguments here.

InputInfo
typeOptional. Entry type, can be one of: FoodEntry, MirrorEntry, MetricEntry, WorkoutEntry, SleepEntry, or NoteEntry.
keywordsOptional. Keywords to search by. Entries can be searched by description.
entry_idOptional. ID of a single Entry to search.
client_idOptional. ID of the Patient associated with this Entry.

Returns a list of Entry objects.

Retrieving a Program

query entry($id: ID, $type: String, $client_id: ID) {
entry(id: $id, type: $type, client_id: $client_id) {
id
type
category
emotions
name
description
}
}

Retrieving a specific Entry is done via the entry query.

InputInfo
idOptional. ID of the Entry to query.
client_idOptional. Used together with type. Returns the last Entry for a specific Client.
typeOptional. Required when using client_id. Fetches an Entry of specific type.

Returns an Entry object.

Creating an Entry

mutation createEntry($type: String, $description: String, $user_id: String, $percieved_hungriness: String) {
createEntry(
input: { type: $type, description: $description, user_id: $user_id, percieved_hungriness: $percieved_hungriness }
) {
entry {
id
}
messages {
field
message
}
}
}

Entries are created via the createEntry mutation. Let’s break down the inputs that mutation accepts.

You can view a full list of potential inputs here.

InputInfo
typeOptional. Valid options are
  • MetricEntry
  • FoodEntry
  • WorkoutEntry
  • MirrorEntry
  • SleepEntry
  • NoteEntry
  • WaterIntakeEntry
  • PoopEntry
  • SymptomEntry
created_atOptional. Date for the new Entry.
user_idOptional. ID of the Patient, otherwise the currently authenticated User will be associated.
percieved_hungrinessOptional. A string index of hungriness.
  • "1" - not hungry
  • "2" - somewhat hungry
  • "3" - very hungry

Returns a createEntryPayload object.

Updating an Entry

mutation updateEntry($id: ID, $type: String, $description: String, $user_id: String, $percieved_hungriness: String) {
updateEntry(
input: {
id: $id
type: $type
description: $description
user_id: $user_id
percieved_hungriness: $percieved_hungriness
}
) {
entry {
id
}
messages {
field
message
}
}
}

The updateEntry mutation shares many common inputs with createEntry and those inputs (e.g type or user_id work the same in both places).

You can view a full list of potential inputs here.

InputInfo
idRequired. The ID of the Entry to update.

Returns an updateEntryPayload object.

Deleting an Entry

Journal Entries can be (soft) deleted by authorized providers and staff members via the deleteEntry mutation.

You can view a full list of potential inputs here.

mutation deleteEntry($id: ID) {
deleteEntry(input: { id: $id }) {
entry {
id
}
messages {
field
message
}
}
}

The deleteEntry mutation is called from an authenticated provider/staff account.

InputInfo
idRequired. ID of the Entry to delete.

Returns a deleteEntryPayload object.