Coder Social home page Coder Social logo

blog-graphql's Introduction

GraphQL + Ruby on Rails

  • Ruby version: 2.7.1
  • Rails version: 6.0.3

Application Pre-Requisits

rbenv install 2.7.1
rbenv rehash
rbenv local 2.7.1
gem install rails

GraphiQL (A GUI for editing and testing GraphQL queries and mutations)

GraphiQL Installer: https://www.electronjs.org/apps/graphiql
GraphQL Endpoint: http://localhost:3000/graphql

Completed Functionality

1. Add Blog application in Rails 6
2. Add GraphQL Gem
3. Add User, Post, Comment type
4. Add User, Post, Comment input type
5. Add User, Post, Comment CRUD mutations
6. Add Authentication, Authorization and Access Control (AAA)

Commands used in GraphiQL

mutation updateAuthor($author: AuthorInputType!) {
 updateAuthor(author: $author)
}

mutation {
 deleteAuthor(id: 1)
}

mutation createAuthor($author:AuthorInputType!) {
 createAuthor(author: $author){
   errors {
     field_name
     errors
   }
 }
}

mutation createUser($user:UserInputType!){
 createUser(user: $user) {
   id
   full_address
   errors {
     field_name
     errors
   }
 }
}

mutation updateUser($user:UserInputType!){
 updateUser(user: $user){
   id
   full_address
   errors {
     field_name
     errors
   }
 }
}

mutation deleteUser($id:ID!){
 deleteUser(id: $id)
}

{
 users {
   id
   posts {
     comments {
       body
     }
   }
 }
}

{
 login(email:"[email protected]", password:"password")
}

{
 currentUser {
   email
 }
}

{
 logout
}

mutation createPost($post:PostInputType!){
 createPost(post: $post){
   id
   body
 }
}

mutation createComment($comment:CommentInputType!){
 createComment(comment: $comment){
   id
   body
 }
}

blog-graphql's People

Contributors

touseefmurtaza93 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.