How to get report stat rows with all metrics
The rowsWithAllMetrics
field in the ReportStat
object is designed to simplify data retrieval in GraphQL queries.
It allows users to fetch all available metrics for each row within a report, without specifying each metric individually.
This feature is particularly useful in scenarios where comprehensive data analysis is required, and all metrics are of interest.
- Query
- Variables
- Response
- cURL
query GetAllMetrics($input: GetReportStatInput!, $after: String) {
getReportStat(input: $input) {
reportTemplate {
name
code
}
rowsWithAllMetrics(first: 10, after: $after, reportType: Basic) {
totalCount
pageInfo {
hasNextPage
endCursor
}
nodes
}
}
}
{
"input": {
"crawlId": "TjAwNUNyYXdsMTc5MDQ3NQ",
"reportTemplateCode": "all_pages",
"segmentId": null
},
"after": null
}
{
"data": {
"getReportStat": {
"reportTemplate": {
"name": "All Pages",
"code": "all_pages"
},
"rowsWithAllMetrics": {
"totalCount": 75,
"pageInfo": {
"hasNextPage": true,
"endCursor": "MTA"
},
"nodes": [
{
"adultRating": false,
"amphtml": false,
"amphtmlReciprocate": false,
"amphtmlValid": false,
"bodyTagsInHeadCount": 0,
"breadcrumbSchemaCount": 0,
"canonicalLinksInCount": 0,
"canonicalizedPage": false,
"contentHtmlRatio": "0.11",
"contentSize": 3925,
"crawlDatetime": "2023-12-08T13:03:35.151Z",
"css": false,
// ....
},
// ...
]
}
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query GetAllMetrics($input: GetReportStatInput!, $after: String) { getReportStat(input: $input) { reportTemplate { name code } rowsWithAllMetrics(first: 10, after: $after, reportType: Basic) { totalCount pageInfo { hasNextPage endCursor } nodes } } }","variables":{"input":{"crawlId":"TjAwNUNyYXdsMTc5MDQ3NQ","reportTemplateCode":"all_pages","segmentId":null},"after":null}}' https://api.lumar.io/graphql