从表中查询10条数据
{
user_info(_limit: 100) {
id
name
}
}
根据id查询数据
{
user_info(
_where: {id: 1727515006802587648}
_order_by: {create_time: _desc}
_limit: 10
) {
id
name
}
}
外键联表查询(特别注意写法:update_by.id):
{
speaker_info(update_by.id: {_eq: 1729043650301321216}, _limit: 10) {
id
update_by {
id
name
uin
owner
}
create_by {
id
}
}
}
##另一种写法:
{
speaker_info(
_where: {update_by.id: 1729043650301321216}
_order_by: {create_time: _desc}
_limit: 10
) {
id
name
update_by {
id
name
uin
owner
}
}
}
根据表id更新数据
mutation update {
speaker_info(
_where: {id: "1732677390281072640"}
_set: {expire_time: "1765096011"}
)
}
根据多条件查询
{
speaker_info(
_where: {status: 1, expire_time: {_lt: 1714360107}}
_order_by: {create_time: _desc}
_limit: 10
) {
apply_uin
id
name
expire_time
}
}
关联关系的多表深层条件过滤筛选
{
speaker_info(apply_user.id: {_eq: 1729043650301321216}, _limit: 10) {
id
name
update_by {
id
name
uin
owner
}
apply_user {
id
name
}
}
}
批量更新/查询
##更新
mutation update {
events_issue_speaker__c(
_where: {id: { _in: [1764840774811058178, 1764840774811058177] }}
_set: {cost_status__c: 1}
)
}
##查询
{
events_meeting(
_where: {meeting_status: 1, create_time: {_lte: 1708312146}, issue.speaker_rel.cost_status__c: 1}
) {
id
meeting_name
issue{
id
meeting_id
speaker_rel{
issue_id__c
cost_status__c
name
id
}
}
}
}