Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ali-ahnaf/dotnet-demos

Contains a bunch of demos illustrating different functionalities of .NET
https://github.com/ali-ahnaf/dotnet-demos

dotnet-core hotchocolate hotchocolate-graphql jwt-authentication mongodb mongodb-driver webapi

Last synced: 17 days ago
JSON representation

Contains a bunch of demos illustrating different functionalities of .NET

Awesome Lists containing this project

README

        

# dotnet-graphql-demo
A demo project illustrating the basics of graphql with HotChocolate

References:
- https://chillicream.com/docs/hotchocolate/get-started

## Follow the steps to run:

- clone the repo
- run ```dotnet watch run```
- go to the mock up url generated. Mine was at ```https://localhost:5001/graphql```

### Example queries:
```graphql
query GetBookById{
book(id: "asdasd2313") {
title
author {
name
}
}
}

query GetBooks{
allBooks{
title
author{
name
}
}
}
```
### Example mutations:
```graphql
mutation AddAuthor {
addAuthor(input: { name: "Hashem", age: 22, booksWritten: 10 }) {
name
age
}
}

mutation AddBook {
addBook(
input: {
author: { name: "Hashem", age: 40, booksWritten: 5 }
title: "Sex and the City"
}
) {
author{
age
name
booksWritten
}
title
}
}
```