But it tells me I cannot query “contact_phone” and “contact_email” on type item.
So I have no idea how to retrieve the contact’s name, email, and phone from that board. I’ve spent the last couple hours looking through the documentation but can’t find anything, so here I am.
The name is an item level field, the rest are column_values and need to be retrieved as such. It is annoying that name cannot be retrieved as a column_value despite being returned in a columns query on the board.
I am using column type fragments to expedite getting the data, but the value key on a column_value is a JSON serialized form of the column’s value. The fragment ... on EmailValue only executes on columns that are of the type email for example, so will return those additional fields.
Pass the column IDs you want in an array to the ids argument of column_values. Always return your ID for boads, items, columns, updates, etc. when querying or else you’ll have no idea which is which.
{
boards(ids: my-board-id) {
id
items_page {
items {
id
name
column_values (ids: ["contact_phone", "contact_email"]) {
id
text
value
type
... on EmailValue {
email
label
}
... on PhoneValue {
phone
country_short_name
}
}
}
}
}
}