DEV Community

Cover image for Demotivation Quotes API (GraphQL + ApolloServer + nodejs)
aravindasiva
aravindasiva

Posted on

4

Demotivation Quotes API (GraphQL + ApolloServer + nodejs)

πŸ˜’ Demotivational Quotes API

A GraphQL API for get random demotivational quotes

Retrieve a random demotivational quote or all demotivational quotes, This is a simple graphQL API.
Contributions or feature ideas are welcome. You can see the Live version

Playground here:

demotivation-quotes-api.herokuapp.com 🀏

NextJS app using this API

negative-space.netlify.app 🀏
Frontend Repo

How to Use

Queries

  • quotes (retrives all the quotes)
  • randomQuote (retrives a random quote from the QuotesData)

Example with data

query {
  quotes {
    id
    quote
    author
  }
}
Enter fullscreen mode Exit fullscreen mode
query {
  randomQuote {
    id
    quote
    author
  }
}
Enter fullscreen mode Exit fullscreen mode

Example Response

{
  "data": {
    "randomQuote": {
      "id": "6",
      "quote": "Those who doubt your ability probably have a valid reason.",
      "author": "unknown"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

How to Install

For running this project locally, you must fork this project first. Then,

yarn
yarn start # Using nodemon for auto-reloading
Enter fullscreen mode Exit fullscreen mode

The server starts at http://localhost:4000/

How to Contribute

First fork this repo
create your branch
add your feature or your quote in QuoteData.js
Push your branch and make a PR

OR

Add your quote and author here

About

Aravinda Siva – LinkedIn – aravindcva@hotmail.com

https://github.com/aravindasiva

API Trace View

Struggling with slow API calls?

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more β†’

Top comments (0)

Billboard image

Try REST API Generation for MS SQL Server.

DevOps for Private APIs. With DreamFactory API Generation, you get:

  • Auto-generated live APIs mapped from database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay