Add insert mutation with bulk insert

This commit is contained in:
Vikram Rangnekar
2019-09-05 00:09:56 -04:00
parent 5b9105ff0c
commit c0a21e448f
30 changed files with 1080 additions and 265 deletions

View File

@ -47,4 +47,79 @@ query {
email
}
}
}
variables {
"insert": {
"name": "Hello",
"description": "World",
"created_at": "now",
"updated_at": "now"
},
"user": 123
}
mutation {
products(insert: $insert) {
id
name
description
}
}
variables {
"insert": {
"name": "Hello",
"description": "World",
"created_at": "now",
"updated_at": "now"
},
"user": 123
}
mutation {
products(insert: $insert) {
id
}
}
variables {
"insert": {
"description": "World3",
"name": "Hello3",
"created_at": "now",
"updated_at": "now"
},
"user": 123
}
{
customers {
id
email
payments {
customer_id
amount
billing_details
}
}
}
variables {
"insert": {
"description": "World3",
"name": "Hello3",
"created_at": "now",
"updated_at": "now"
},
"user": 123
}
{
me {
id
full_name
}
}

View File

@ -84,8 +84,9 @@ database:
#log_level: "debug"
# Define variables here that you want to use in filters
# sub-queries must be wrapped in ()
variables:
account_id: "select account_id from users where id = $user_id"
account_id: "(select account_id from users where id = $user_id)"
# Define defaults to for the field key and values below
defaults:
@ -105,12 +106,12 @@ database:
# This filter will overwrite defaults.filter
# filter: ["{ id: { eq: $user_id } }"]
- name: products
# Multiple filters are AND'd together
filter: [
"{ price: { gt: 0 } }",
"{ price: { lt: 8 } }"
]
# - name: products
# # Multiple filters are AND'd together
# filter: [
# "{ price: { gt: 0 } }",
# "{ price: { lt: 8 } }"
# ]
- name: customers
# No filter is used for this field not

View File

@ -82,8 +82,9 @@ database:
#log_level: "debug"
# Define variables here that you want to use in filters
# sub-queries must be wrapped in ()
variables:
account_id: "select account_id from users where id = $user_id"
account_id: "(select account_id from users where id = $user_id)"
# Define defaults to for the field key and values below
defaults: