GraphQL Killer

GraphQL 101: An Overview and Walkthrough

Installation

npm install graphql @apollo/server mongodb

Usage

First connect to mongodb using the following command. Make sure you have installed mongosh

mongosh

This will kick start a local development connection with mongodb.

Define your Schemas

export const typeDefs = `#graphql type User { id: ID! username: String! email: String! } type Articles{ id: ID! title: String! content: String! } type Comments { id: ID! user: User! date: String! } `