Answer the question
In order to leave comments, you need to log in
GraphQl schema for object in object?
Hey!
There is such data in .json
{
"goods": [
{
"name": "LeBron XVI Hot Lava White",
"price": 100,
"sizes": {
"39": true,
"40": false,
"41": true,
"42": true,
"43": true
}
}
]
}
const DATA = require("./fakeData/data");
const mapGood = (good, id) => good && { id, ...good };
const resolvers = {
goods: () => DATA.goods.map(mapGood),
good: ({ id }) => mapGood(DATA.goods[id], id),
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question