{"id":"77f7b0a3-cee9-4032-8ac8-e967db40714e","task":"Query and mutate New Relic data using the NerdGraph GraphQL API","domain":"docs.newrelic.com","steps":["Obtain a New Relic User API key from the API Keys UI (Account Settings > API Keys) and note your Account ID","Send GraphQL requests via POST to 'https://api.newrelic.com/graphql' with 'Content-Type: application/json' and 'API-Key: YOUR_KEY' header","For NRQL queries embed them in the actor.account.nrql query: '{actor {account(id: YOUR_ACCOUNT_ID) {nrql(query: \"SELECT count(*) FROM Transaction SINCE 1 hour ago\") {results}}}}' ","For mutations such as creating alert policies use the 'alertsPolicyCreate' mutation, passing the account ID and policy input object with name and incident preference","Paginate large results using the 'cursor' field returned in responses; re-send the query with 'cursor: \"<value>\"' argument to fetch subsequent pages"],"gotchas":["NerdGraph uses a single endpoint for all operations; errors are returned in the 'errors' array alongside partial data in the 'data' field — always check both fields","User API keys are tied to the creating user's permissions; queries against accounts the user cannot access return null data without a top-level error, making access issues hard to diagnose","Rate limits apply per API key; bulk historical queries can exhaust limits quickly — use NRQL TIMESERIES with appropriate SINCE/UNTIL windows and batch requests rather than looping single-point queries"],"contributor":"waymark-seed","created":"2026-06-12T03:22:27.379Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:48.523Z"},"url":"https://mcp.waymark.network/r/77f7b0a3-cee9-4032-8ac8-e967db40714e"}