Giter Club home page Giter Club logo

graphql-express-node-docker-json's Introduction

Graphql Nodejs application with express and JSON Files

I made this application with lot of interest and to help opensource society to use this as boilerplate to kick start their projects.

What about testcases?

I integrated with Mocha chai to test our code.

How to start this application?

If you have Nodejs installed machine then follow below steps?

 npm install

 npm run dev:api

We ship our code through Docker.

Just enter below command to spin container

  docker-compose up

Create a Owner

mutation CreateOwner($input: CreateOwnerInput!){
  createOwner(input:$input){
    id
    name
    email
    address
    mobile
  }
}

Create a Owner along with pet if it is available

mutation CreateOwner($input: CreateOwnerInput!){
  createOwner(input:$input){
    id
    name
    email
    address
    mobile
    pet:[Int]
  }
}

Getting Owners along with pets

query Owners {
  owners{
    id
    name
    email
    address,
    mobile,
    pets {
      name
    }
  }
}

Getting Owners only

query Owners {
  owners{
    id
    name
    email
    address,
    mobile
  }
}

Updating Owner

mutation UpdateOwner($id: Int!, $input: CreateOwnerInput!) {
  updateOwner(id: $id, input: $input) {
    id
    name
    email
    address
    mobile
  }
}

Deleting Owner

mutation DeleteOwner($id: Int!){
  deleteOwner(id: $id){
    message
  }
}

Update Pet

mutation UpdatePet($id:Int!, $input: CreatePetInput!) {
  updatePet(id: $id, input: $input){
    	id
    name
    breed
    colour
    age
  }
}

Input for Owner and Pets

{
  "input":  {
    "name":"Siddhu",
    "email":"[email protected]",
    "address": "Hyderabad",
    "mobile": "+91-9581594325"
	}
}

{
  "id": 1,
  "input":  {
    "name":"Siddhu",
    "email":"[email protected]",
    "address": "Hyderabad",
    "mobile": "+91-9581594325",
    "pets":[1,2]
	}
}

{
  "input":  {
    "name":"Kicchu",
    "breed": "Persian",
    "age": 10,
    "colour": "red"
	}
}

{
  "id": 1,
  "input":  {
    "name":"chakki",
    "breed": "Persian",
    "age": 10,
    "colour": "red"
	}
}

graphql-express-node-docker-json's People

Contributors

sumanag31 avatar vydyas avatar

Watchers

 avatar  avatar

Forkers

gggneo

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.