Sa1Gur / GraphQLWithHotChocolate

DotNetCore API with GraphQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQLWithHotChocolate

DotNetCore API with GraphQL

intially taken from https://blexin.com/en/blog-en/creating-our-api-with-graphql-and-hot-chocolate/.

Modified to demo HotChocolate functionality

query all books

query 
{
  books
  {
    nodes
    {
      id,
      title
    }
  }
}

delete book

mutation
{
  deleteBook(inputBook:
    {
    id: 4
    }    
  )
  {
    title    
  }
}

create book

mutation
{
  createBook(inputBook: {
    title: "Приключения капитана Вру"
    authorId: 1
    price: 1999
  })
  {
    id
  }
}

update book

mutation
{
  updateBook(inputBook: {
    id: 4
    title: "Winny the Pooh"
  })
  {
    title
  }
}

About

DotNetCore API with GraphQL


Languages

Language:C# 100.0%