I am using Apollo server 2.0 as graphql aggregation layer over my rest apis ( different microservices).
I want to generate graphql schema directly from the api response of microservices instead of manually writing them by hand which could be error prone.
e.g If my api response is
const restApiResponse = {
"id": 512,
"personName": "Caribbean T20 2016",
"personShortName": "caribbean-t20 2016",
"startDate": "2016-06-29T19:30:00.000Z",
"endDate": "2016-08-08T18:29:59.000Z",
"status": 0,
};
Then I want to generate below schema based on the typeName supplied e.g Person
-
type Person {
id: Float
personName: String
personShortName: String
startDate: String
endDate: String
status: Float
}