Refactor Super Graph into a library #26
This commit is contained in:
21
core/corpus/1
Normal file
21
core/corpus/1
Normal file
@ -0,0 +1,21 @@
|
||||
query {
|
||||
products(
|
||||
# returns only 30 items
|
||||
limit: 30,
|
||||
|
||||
# starts from item 10, commented out for now
|
||||
# offset: 10,
|
||||
|
||||
# orders the response items by highest price
|
||||
order_by: { price: desc },
|
||||
|
||||
# no duplicate prices returned
|
||||
distinct: [ price ]
|
||||
|
||||
# only items with an id >= 30 and < 30 are returned
|
||||
where: { id: { and: { greater_or_equals: 20, lt: 28 } } }) {
|
||||
id
|
||||
name
|
||||
price
|
||||
}
|
||||
}
|
14
core/corpus/2
Normal file
14
core/corpus/2
Normal file
@ -0,0 +1,14 @@
|
||||
query {
|
||||
products(
|
||||
where: {
|
||||
or: {
|
||||
not: { id: { is_null: true } },
|
||||
price: { gt: 10 },
|
||||
price: { lt: 20 }
|
||||
} }
|
||||
) {
|
||||
id
|
||||
name
|
||||
price
|
||||
}
|
||||
}
|
12
core/corpus/3
Normal file
12
core/corpus/3
Normal file
@ -0,0 +1,12 @@
|
||||
query {
|
||||
products(
|
||||
where: {
|
||||
and: {
|
||||
not: { id: { is_null: true } },
|
||||
price: { gt: 10 }
|
||||
}}) {
|
||||
id
|
||||
name
|
||||
price
|
||||
}
|
||||
}
|
12
core/corpus/4
Normal file
12
core/corpus/4
Normal file
@ -0,0 +1,12 @@
|
||||
query {
|
||||
products(
|
||||
where: {
|
||||
and: [
|
||||
{ not: { id: { is_null: true } } },
|
||||
{ price: { gt: 10 } },
|
||||
] } ) {
|
||||
id
|
||||
name
|
||||
price
|
||||
}
|
||||
}
|
6
core/corpus/5
Normal file
6
core/corpus/5
Normal file
@ -0,0 +1,6 @@
|
||||
query {
|
||||
product(id: $PRODUCT_ID, where: { price: { eq: $PRODUCT_PRICE } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
6
core/corpus/6
Normal file
6
core/corpus/6
Normal file
@ -0,0 +1,6 @@
|
||||
query {
|
||||
product(id: 15) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
6
core/corpus/7
Normal file
6
core/corpus/7
Normal file
@ -0,0 +1,6 @@
|
||||
query {
|
||||
products(search: "Imperial") {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
22
core/corpus/8
Normal file
22
core/corpus/8
Normal file
@ -0,0 +1,22 @@
|
||||
query {
|
||||
products(
|
||||
# returns only 30 items
|
||||
limit: 30,
|
||||
|
||||
# starts from item 10, commented out for now
|
||||
# offset: 10,
|
||||
|
||||
# orders the response items by highest price
|
||||
order_by: { price: desc },
|
||||
|
||||
# only items with an id >= 30 and < 30 are returned
|
||||
where: { id: { and: { greater_or_equals: 20, lt: 28 } } }) {
|
||||
id
|
||||
name
|
||||
price
|
||||
user {
|
||||
full_name
|
||||
picture : avatar
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user