Web Developer
hey guys,
I know query doesn't support relational field yet, so my idea was to try graphQL to get exact data I need from inside that relationship field but couldn't get anywhere. I tried something like
graphql.query({
query: `
query {
databasesListDocuments(
databaseId: "[id]",
collectionId: "[colId]"
) {
total
documents {
_id,
data {
attachmentType,
attachmentURL,
body,
user_id {
_id
avatar
firstname
lastname
username
}
}
}
}
}
but that didn't work.. I really don't want to return the whole obj as it will have so many unnecessary data but not sure how, is there anyway around that? I'm building react Native app btw