[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.67 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.67 KB

GraphQL API

project-image

GraphQL Queries

To test the application, please click on the following link to view all the queries.

Queries Link
Create User Mutation Link
Login User Mutation Link
Get User Query Link
Create Product Mutation Link
Get Product Query Link
Get Products Query Link

Bootstrap Server

Run the following commands

    mkdir gql-api
    cd gql-api
    echo "node_modules\n.DS_Store\n.env" > .gitignore
    git init
    npm init -y
    npm install -g typescript
    tsc --init -y

Install Dependencies

    npm i --save type-graphql apollo-server graphql@15.x reflect-metadata @typegoose/typegoose mongoose class-validator bcrypt jsonwebtoken cookie-parser config dotenv

Install Dev-Dependencies

    npm install --save-dev @types/express @types/node @types/cors @types/jsonwebtoken @types/lodash pino-pretty @types/cookie-parser ts-node-dev typescript

Generate Encryption Keys

Change to the project's root directory and execute the following bash command

    mkdir certs && cd certs && openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:4096 && openssl rsa -in private_key.pem -pubout -out public_key.pem