> run-api\via-dotnet-cli.bat
> browse to http://localhost:5000/ui/playground
Confluence - https://techfactor.atlassian.net/l/c/HE5GnM1C
GraphQL is query language for API. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
You can open playground localhost:5000/ui/playground and run below query
query{
orders
{
id
orderLine
{
productType
quantity
}
requiredBinWidth
}
}
or pass query as argument to /graphql endpoint
http://localhost:5000/graphql?query={orders{id,orderLine{productType,quantity}requiredBinWidth}}
You can open playground localhost:5000/ui/playground and run below query
query{order(id: 1)
{
id
orderLine
{
productType
quantity
}
requiredBinWidth
}
}
or pass query as argument to /graphql endpoint
http://localhost:5000/graphql?query={order(id:1){id,orderLine{productType,quantity}requiredBinWidth}}
mutation($order: [OrderLine]!){
createOrder(orderlines: $order)
{
id,
requiredBinWidth,
orderLine
{
productType
quantity
}
}
}
and add query variables
{
"order": [
{"productType": "PHOTO_BOOK","quantity": 1},
{"productType": "CALENDAR","quantity": 2},
{"productType": "MUG","quantity": 4}
]
}
The JSON request for this mutation would look like:
{
"query": "mutation ($orderlines:[OrderLine]!){ createOrder(orderlines: $orderlines) { id, requiredBinWidth, orderLine {productType, quantity } } }",
"variables": {
"orderlines": [
{"productType": "PHOTO_BOOK","quantity": 13},
{"productType": "CALENDAR","quantity": 2},
{"productType": "MUG","quantity": 7}
]
}
}
You can generate coverage report for solution and view in html
Run
coverage\generate-report.bat
This will
Run Tests in solution
Generate coverage report in html
Open report in browser
You can run Web API on target as Windows or in Docker container.
Required - Docker Engine Installed https://docs.docker.com/engine/install/
Run
run-api\via-docker.bat
Prerequisite
Required - Dotnet Core 3.1 SDK https://dotnet.microsoft.com/download/dotnet/3.1
Optional - Visual Studio 2019 https://visualstudio.microsoft.com/vs/
Run
run-api\via-dotnet-cli.bat