Skip to content

This is a ExpressJS application serving GraphQL queries

Notifications You must be signed in to change notification settings

nohimys/graphql-expressjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-expressjs

This is a ExpressJS application serving GraphQL queries

Sample Queries for Testing

Sample Query 01

Get all books & their author details

{
  books {
    id
    name
    authorId
    author {
      name
    }
  }
}

Sample Query 02

Get all authors & their books

{
  authors {
    id
    name
    books {
      name
      id
    }
  }
}

Sample Query 03

Get book by id

{
  book(id: 1) {
    name
    author {
      name
    }
  }
}

Sample Query 04

Get author by id

{
  author(id: 1) {
    name
  }
}

Sample Query 05

Get all books by author name

{
  author (name: "J. K. Rowling") {
    name
    books {
      name
      id
    }
  }
}

Sample Query 06

Add new book to array

mutation{
  addBook ( name: "Atomic Habbits", authorId: 1) {
    name
    authorId
  }
}

About

This is a ExpressJS application serving GraphQL queries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published