use Gentics\PortalPhp\Features\Mesh\Mesh;
class Controller
{
public function example()
{
// Basic Query starts with the request() factory method
$response = Mesh::request()
// This will load resources/graphql/myTemplate.graphql
->setTemplateName('myTemplate')
// Send request to Mesh
->fetch();
// If you need an array, you can convert the response
$responseArray = $response->toArray();
// Return the response array as JSON
return response()->json($responseArray);
}
}