Useful Queries

export const HAS_TOKEN = gql`
query HasToken($ownerId: String!, $thingId: String!) {
token(
where: { ownerId: { _eq: $ownerId }, thing: { id: { _eq: $thingId } } }
) {
id
}
}
`
export const GET_USER_THINGS = gql`
query getUserThings($account: String!) {
thing(
where: {
tokens: { ownerId: { _eq: $account }, burnedAt: { _is_null: true } }
}
limit: 12
) {
tokens {
id
ownerId
royaltys {
percent
account
}
splits {
percent
account
}
}
id
store {
id
}
storeId
metaId
}
}
`
const GET_LATEST_LIST = gql`
query getMyMarketThings($limit: Int!, $lastDate: timestamptz!) {
markets(
where: {
list: { removedAt: { _is_null: true } }
createdAt: { _lte: $lastDate }
}
order_by: { createdAt: desc }
limit: $limit
) {
id
createdAt
createdBy
thing {
id
metaId
}
list {
price
groupId
ownerId
autotransfer
createdAt
token {
splits {
id
account
txId
}
royaltys {
id
account
txId
}
}
}
}
}
`