Skip to content

mkuehne-git/graphql-quick-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-quick-start

This is a very simple node demo for graphQL based on a frequently used author/books example. Since authors are writing books this example shows a one to many relationship.

The demo contains three apps:

  • app.js contains queries for authors, books, author by id, and book by id
  • app1.js adding lazy resolver for Author.books
  • app2.js adding mutation to create a new author and add a book to an author

Getting Started

  1. Copy all the files to your local machine.
  2. Open a terminal and cd into the target folder of your copy
  3. Run npm install
  4. Edit the file package.json and change the "main" property to app.js, app1.js or app2.js
  5. Run npm start
  6. Open browser at (http://localhost:4000/graphql)
  7. Enter query like
{
  authors {
    id
    name
    books {
      title
    }
  }
}

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Demo of GraphQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published