chungchi300 / grapthql-server-using-appollo-server-and-grapthql-express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Summary

Appollo server and Grapthql-express just provide interface for grapthql.Implementation need to be done by yourself

graphql-demo.

A simple graphql-demo, which exposes an endPoint which can be quiered for books.

Schema:

  type Book {
    id: ID!
    title: String!
    author: String!
    isbn: String!
    url: String!
  }

  type Query {
    allBooks: [Book!]!
  }

  type Mutation {
    createBook(title: String!, author: String!): Book
  }

Query samples:

query {
  allBooks {
    author,
    title
  }
}
query{
  allBooks(filter:{
    id:17
  }) {
    isbn
  }
}

Try the endPoint.

About


Languages

Language:JavaScript 100.0%