Slides are in the docs folder:
Code samples:
Clone this git repository on your local machine. And run the application using the Spring Boot Maven plugin.
On Mac/Unix
./mvnw spring-boot:run
On Windows
mvnw spring-boot:run
Once it is started, browse to: http://localhost:8080/graphiql
Now you can try to query the model (control+space will help you). An example query to retrieve all orders:
query {
orders {
id
totalPrice
orderItems {
quantity
product {
title
price
imageUrl
}
shipment {
status
}
}
}
}
To generate a response that includes an errors element you can include the exception field inside orderItems. This demonstrates that the order information is returned but the OrderItem field names exception is null.
query {
orders {
id
totalPrice
orderItems {
exception
quantity
product {
title
price
imageUrl
}
shipment {
status
}
}
}
}
You can place an order by executing the following mutation query:
mutation CreateOrder($order: OrderInput) {
createOrder(order: $order) {
id
totalPrice
orderItems {
quantity
product {
title
price
imageUrl
}
}
}
}
Using this query variable:
{
"order": {
"orderItems": [
{
"productId": "123",
"quantity": 1
},
{
"productId": "234",
"quantity": 1
}
]
}
}
If you have any questions or maybe you want to request a presentation or workshop, then please send a mail to: info@sourcelabs.nl