Giter VIP home page Giter VIP logo

graph_ql's Introduction

Installation

Clone this repo and open two terminal windows in the root directory. In the first terminal, run an npm install:

$ npm install

In the second terminal, you can start your docker server with the following commands:

$ cd docker

$ docker-compose -f stack.yml up

Your docker server should now be up and running. In the first terminal (still in the root directory), you can initialize the GraphQL server with seed data:

$ npm run seed

Now you should be ready to start the Apollo server. To do so, run:

$ npm run dev

Resolvers

In the playground created on port 4000, you can interact with the GraphQL API in the following ways.

{
 firstPokemon {
    id
    name
    classification
  }
}

Returns the first Pokemon in the database.

{
 findPokemon(pkId: "id") {
    id
    name
    classification
  }
}

Returns a specific pokemon when passed an ID. Replace 'id' with the autoId of the pokemon you'd like to reference.

{
 createPokemon {
    id
    name
    classification
  }
}

Creates a new Pokemon and adds it to the database.

{
 upsertPokemon {
    id
    name
    classification
  }
}

Updates an existing Pokemon, or adds a new one if one does not exist.

{
 resetPokemon {
    id
    name
    classification
  }
}

Resets the database. The original dataset can be obtained again by running the NPM seed command.

graph_ql's People

Contributors

sabejensen avatar

Watchers

 avatar  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.