Is there any way to tag request in Telescope?
The telescope provides a feature to assign custom tag any request.
Currently in the telescope dashboard shows all the GraphQL query as /graphql.
It is really hard to debug a particular query.
I don't use telescope so can't help much 🤷♀️
I use this:
Telescope::tag(function (IncomingEntry $entry) {
if (($entry->type === EntryType::REQUEST) && (null !== ($operationName = request()->input('operationName')))) {
return ['GraphQL:'.$operationName];
}
if (($entry->type === EntryType::REQUEST) && (null !== ($operationName = request()->header('x-apollo-operation-name')))) {
return ['GraphQL:'.$operationName];
}
return [];
});
Thanks a lot, @illambo For code snippet.
I will try this way 🙂