skorotkiewicz / node-graphql-starter

Very simple GraphQL starter in NodeJS + MongoDB + Apollo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL starter in NodeJS + MongoDB + Apollo

Very simple starter to understand the principle of GraphQL

Getting started

  1. Clone this repo using https://github.com/skorotkiewicz/node-graphql-starter.git
  2. Move to the appropriate directory: cd gnode-graphql-starter.
  3. Run npm install to install dependencies.
  4. Set .env file with your mongoURI.
  5. Run npm start to see the GraphQL at http://localhost:4000/graphql.

Get data

{
  getUsers {
    id
    name
    email
    password
  }

  getPosts {
    id
    title
    description
  }
}

Post data

mutation {
  addPost(title: "Awasome Post!", description: "My new post <3") {
    id
    title
    description
  }
}

About

Very simple GraphQL starter in NodeJS + MongoDB + Apollo


Languages

Language:JavaScript 100.0%