Skip to content

Repository files navigation

Graphql and Express · GitHub license PRs Welcome

This examples is an backend of Graphql CRUD

How to test in production

  1. Go to site to test api
  2. Add URL service: https://salty-escarpment-98757.herokuapp.com/
  3. Add queries that are at the bottom

See the proyect

Libraries & Tech

  • Mongo DB
  • NodeJS
  • GraphQL Yoga
  • Docker

How to run

  1. Install docker
  2. Intall docker compose
  3. Run docker-compose build
  4. Run docker-compose up
  5. Go to localhost:4000
  6. Fork and enjoy!

Font end

I created an example with Angular, you can fork the project in my other repo

Schemas

getCharacters

{
  character{
    id
    name
    race
    image
    power
  }
}

createCharacter

mutation createCharacter{
  createCharacter(
    name: "Goku kid", 
    power:"11", 
    image:"https://i.pinimg.com/originals/3a/bc/7d/3abc7db51ec2f3671ad5eb4aef15db8b.png",
    race:"Sayan"){
    name
    power
    race
    image
  }
}

Update character

 mutation updateCharacter(
    $id: ID!
    $name: String!
    $power: String!
    $image: String!
    $race: String!
  ) {
    updateCharacter(
      id: $id
      name: $name
      power: $power
      image: $image
      race: $race
    ) {
      id
      name
      power
      race
      image
    }
  }

Delete character

 mutation deleteCharacter($name: String!) {
    deleteCharacter(name: $name)
  }

Subscriptions

On create new character

subscription newCharacter {
    newCharacter {
      id
      name
      power
      image
      race
    }
  }

On delete character

subscription oldCharacter {
    oldCharacter
  }

About

Example Express and Graphql

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages