Skip to content

shashankjo/graphql-learning

 
 

Repository files navigation

Integrating GraphQL with ruby on rails

This project is a basic sekeleton of Author Library system. The application is built in ruby on rails and is using GRAPHQL for data manipulation.

This project is Walk through application presented in RubyConf Pakistan.

Queries

FETCH LIST OF AUTHORS WITH ALL DETAILS(BOOKS AND CHAPTERS)

query{
  authors {
    id
    name
    bookCount
    books {
      name
      description
      chapters {
        name
        shortDescription
        authorName
      }
    }
  }
}

FETCH SINGLE AUTHOR


query{
  author(id: 1) {
    id
    name
    bookCount
    books {
      name
      description
      chapters {
        name
        shortDescription
        authorName
      }
    }
  }
}


Mutations

CREATE AUTHOR

mutation{
  createAuthor(input: {
    name: "mehreen"
    email: "[email protected]"
  }){
    author {
      name
      id
    }
    errors
  }
}

UPDATE AUTHOR

mutation{
  updateAuthor(input: {
    id: "1"
    name: "mehreen-abc"
  }){
    author {
      name
      id
    }
    errors
  }
}

About

Integrating GraphQL with ruby on rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 79.6%
  • HTML 15.3%
  • JavaScript 3.2%
  • CSS 1.9%