Giter VIP home page Giter VIP logo

whisperer-api's Introduction

WHISPERER

GraphQL API powering the Whisperer application where you can share your thoughts anonymously.


It's powered by:

apollo-server is the core library for Apollo Server itself, which helps you define the shape of your data and how to fetch it.

graphql is the library used to build a GraphQL schema and execute queries against it.


The schema for the whisperer-API can be found here. There are a number of queries and mutations contained in that file and that is what makes us up the Whisperer-API. There is work ongoing to add subscriptions to the API.

Queries

The following are the queries available on the whisperer API.

  • Fetch all users - this is used to fetch all users registered on the Whisperer-API. This endpoint will only be visible to a hard-coded admin. You also require a JWT to access this resource.

Example:

query {
  users {
    id
    firstname
    surname
    email
    username
  }
}
  • Profile: To view the profile of the currently logged in user.
query {
  profile {
    id
    firstname
    surname
    email
    username
    whispers {
      id
      text
    }
  }
}
  • Whispers: Fetch whispers on the platform. I'm working on adding pagination to this resource.
query {
  whispers {
    id
    text
    whisperer {
      id
      username
    }
  }
}

Mutation

The following are the queries available on the whisperer API.

  • CreateUser: equivalent of the /signup endpoint on a traditional REST API.
mutation {
  createUser(
    payload: {
      firstname: "Bolaji"
      lastname: "Proton"
      email: "[email protected]"
      password: "password123"
      confirmPassword: "password123"
    }
  ) {
    token
    user {
      id
      username
      email
      firstname
      lastname
    }
  }
}
  • Signin: equivalent of the /signin endpoint on a traditional REST API.
mutation {
  signin(
    payload: {
      email: "[email protected]"
      password: "password123"
    }
  ) {
    token
    user {
      id
      username
      email
      firstname
      lastname
    }
  }
}
  • CreateWhisper: this is used for creating whispers
mutation {
  createWhsiper(
    payload: {
      text: "I am bored"
    }
  ) {
    id
    text
    whisperer {
      id
      username
    }
  }
}

whisperer-api's People

Contributors

bolajiolajide avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.