mutation($request: SignupRequest!) {
signup(request: $request) {
username
email
roles
}
}
and query variable
{
"request": {
"username": "ashutosh",
"password": "ashu@123",
"email": "ashu@email.com"
}
}
mutation($request: LoginRequest!){
login(request: $request){
token
username
roles
}
}
and query variable
{
"request": {
"username": "ashutosh",
"password": "ashu@123"
}
}
Use the response token to add into Authorization header for all the following requests.
mutation($product: ProductInput!) {
createProduct(product: $product) {
id
name
}
}
and query variable
{
"product": {
"id": "1",
"name": "samsung tv",
"description": "Its a good tv",
"price": "20000"
}
}
query {
productById(id: "1") {
id
name
}
}
query {
customerById(id: "1") {
id
name
orders {
quantity
id
product {
id
name
}
}
}
}
mutation($order: CreateOrderInput!) {
createOrder(order: $order) {
id
customer {
name
}
product {
name
description
price
}
quantity
status
}
}
and query variable
{
"order": {
"customerId": "1",
"productId": "1",
"quantity": 3
}
}