• Log in
Anwen  Share and Create
  • Book
  • Movies
  • Music
  • SF
  • Goodlink
  • Asks
  • Eyeopen
  • Create

Wrapping RESTful in GraphQL

Sharer: 林一二的开放记忆 February 12, 2017 at 2:26 am
Link Share :https://onetwo.ren/wrapping-restful-in-graphql/ - via RSS

Abstraction

From frontend dev aspect of view, GraphQL is a data layer paradigm that supports declarative Optimistic Update, fetch data following with use, data WYSIWYG, etc. It truly has some advantage above RESTful API, I’m going to introduce how to wrap existing RESTful API into a GraphQL API Gateway, without bothering backend dev, using an example that has been production tested.

Background

An outsourced project has some interesting relics, for example, it’s API usage:

import * as Mapi from '../../lib/Mapi'; // ... componentWillMount() { Mapi.districtPie(this.props.id) .then(json => { if (json.data.code === 0 && json.data.data !== undefined) {...
作者暂无likerid, 赞赏暂由本网站代持,当作者有likerid后会全部转账给作者(我们会尽力而为)。

Tips: Until now, everytime you want to store your article, we will help you store it in Filecoin network. In the future, you can store it in Filecoin network using your own filecoin.


Support author:
Author's Filecoin address:
Or you can use Likecoin to support author:
tags:Redux Apollo React graphQL Journal

0 0

2012-2018 Anwen All of our posts are default licensed under CC BY 4.0 About Help Changelog Telegram
Today Quote: 对于强者来说,失败会激励他们。对于弱者来说,失败会使他们更加失败。 -- 罗伯特 T. 清崎,《富爸爸,穷爸爸》的作者