Make REST api to partial response, just like GraphQL
30 Oct, 2018
The story begins in one day, I want to make NodeJS API endpoints like
GET /api/blogposts?fields=author{name,avatar},title,detail
and it should return me
[{
"author": {
"name": "Liam Ng",
"avatar": "https://someurl",
},
"title": "blogpost title",
"detail": "blogpost detail"
}]
Make REST api to partial response, just like GraphQL
30 Oct, 2018
The story begins in one day, I want to make NodeJS API endpoints like
GET /api/blogposts?fields=author{name,avatar},title,detail
and it should return me
[{
"author": {
"name": "Liam Ng",
"avatar": "https://someurl",
},
"title": "blogpost title",
"detail": "blogpost detail"
}]