Giter Club home page Giter Club logo

blogsrvr's Introduction

API app that takes uses a singular REST api resource and augments it to include multiple query parameters. Output is a graphql resource as well as a REST api

Source API: /blog/posts Method: ​GET Parameters: (required) The tag associated with the blog post

Returns json object: {"posts"​: [{"id"​: ​1​,"author"​: ​"Rylee Paul"​,"authorId"​: ​9​,"likes"​: ​960​,"popularity"​: ​0.13​,"reads"​: ​50361​,"tags"​: [ ​"tech"​, ​"health" ​]},...]}

This apps api: Route: ​/api/ping Method: ​GET

Route: ​/api/posts Method: ​GET

Field Type Description Default Example
tags String(required) A comma separatedlist of tags. N/A science,tech
sortBy String(optional) The field to sort theposts by. The acceptable fields are: *id *reads *likes *popularity id popularity
direction String(optional) The direction forsorting. The acceptable fields are: *desc *asc asc asc

Built using node, express and apollo server. Done to demostrate the benefits of graphql. apollo graphql server allows us to take a REST endpoint and use it as a source for queries of any arrangement that the frontend might need. We can also produce a REST api output alongside built on top of graphql.

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.