I do not know how to ask but I summarize what I want to do. I have a laravel server with lighthouse I do not handle databases or models, my data source is an api that returns the data in a json, now my query is how do I convert or map the json for a graphql query?
the structure of my json is more or less like this:
{
"order" :
[
{
"details":
{
"id": "file",
"value": "File"
}
},
{
"menu":
{
"menuitem":
[
{"value": "New", "onclick": "CreateDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Save", "onclick": "SaveDoc()"}
]
}
}
]
}
and the structure of my schematic is something like this:
type order {
details: details
menu: menu
}
type details {
id: String
value: String
}
type menu {
menuitem: menuitem
}
type menuitem {
value: String
onclick: String
}
type query {
orders: [order]
}
the solution is for the custom resolver or the eloquent models or something else, if someone could guide me it would be very helpful