TAAFT
Free mode
100% free
Freemium
Free Trial
Deals

BaseMax / ProgrammerSocialNetworkGraphQL

This is a GraphQL API for a programmer/developer social network that allows users to view, filter, sort, add, edit, and delete developers based on their programming skills.

3 1 Language: TypeScript License: GPL-3.0 Updated: 6d ago

README

Programmer Social Network GraphQL API

This is a GraphQL API for a programmer/developer social network that allows users to view, filter, sort, add, edit, and delete developers based on their programming skills.

Getting started

To use this API, you'll need to have Node.js and npm installed on your computer.

  • Clone this repository to your computer.
  • Run npm install to install the required dependencies.
  • Set up a MongoDB database and configure the connection in src/config/index.js.
  • Run npm start to start the GraphQL server.
  • Open a web browser and go to http://localhost:4000/graphql to use the GraphQL interface.

Technologies Used

This API was built with:

  • Node.js
  • NestJS
  • TypeScript
  • GraphQL
  • MongoDB

Usage

Queries

Get list of developers

query {
  developers {
    id
    firstName
    lastName
    email
    skills {
      language
      framework
    }
  }
}

Filter developers by skill

query {
  developers(filter: { skills: { language: "C#" } }) {
    id
    firstName
    lastName
    email
    skills {
      language
      framework
    }
  }
}

Sort developers by name

query {
  developers(sortBy: "lastName") {
    id
    firstName
    lastName
    email
    skills {
      language
      framework
    }
  }
}

Mutations

Add a new developer

mutation {
  addDeveloper(input: { firstName: "John", lastName: "Doe", email: "[email protected]", password: "password123", skills: [{ language: "C#", framework: "ASP.NET" }] }) {
    id
    firstName
    lastName
    email
    skills {
      language
      framework
    }
  }
}

Edit a developer

mutation {
  editDeveloper(id: "<developer id>", input: { firstName: "John", lastName: "Doe", email: "[email protected]", skills: [{ language: "C#", framework: "ASP.NET" }, { language: "React", framework: null }] }) {
    id
    firstName
    lastName
    email
    skills {
      language
      framework
    }
  }
}

Delete a developer

mutation {
  deleteDeveloper(id: "<developer id>") {
    id
  }
}

Register a new user

mutation {
  register(input: { firstName: "John", lastName: "Doe", email: "[email protected]", password: "password123" }) {
    token
  }
}

Login

mutation {
  login(input: { email: "[email protected]", password: "password123" }) {
    token
  }
}

Authors

  • Amirhossein Malekian
  • Max Base

Copyright 2023, Max Base

0 AIs selected
Clear selection
#
Name
Task