Skip to content

Latest commit

 

History

History
109 lines (77 loc) · 1.96 KB

File metadata and controls

109 lines (77 loc) · 1.96 KB

graphql-tutorial

A GraphQL tutorial project built in Node.js. This project was started based on a tutorial on YouTube but has been significantly embellished to demonstrate advanced GraphQL capabilities. The purpose of this app is to showcase my ability to create a GraphQL Node.js application.

Description

This project serves as a demonstration of creating a GraphQL server using Node.js, TypeScript, and Apollo Server. It includes examples of how to define a GraphQL schema, create resolvers, and handle relationships between data entities.

Live Demo

The live demo will be available soon. (Coming later)

Installation

To run this project locally, follow these steps:

Prerequisites

  • Node.js (v14 or later)
  • npm (v6 or later)
  • TypeScript (v4 or later)

Steps

  1. Clone the repository:
git clone https://github.com/Fast-Dog-Coding/graphql-tutorial.git
cd graphql-tutorial
  1. Install dependencies:
npm install
  1. Compile TypeScript files:
npm run compile
  1. Start the server:
npm start

The GraphQL server will be running at http://localhost:4000.

Example Queries

Once the server is running, you can use the following example queries to test the GraphQL API:

  • Get all reviews:
query {
  reviews {
    id
    rating
    content
    author {
      name
    }
    game {
      title
    }
  }
}
  • Add a new review:
mutation {
  addReview(input: {
    rating: 10,
    content: "Fantastic game!",
    author_id: "1",
    game_id: "1"
  }) {
    id
    rating
    content
    author {
      name
    }
    game {
      title
    }
  }
}

Credits

  • This project is based on the GraphQL Crash Course by NetNinja.
  • Additional help and guidance from ChatGPT by OpenAI.

License

This project is licensed under the ISC License.

Copyright

Copyright © 2024 Fast Dog Coding