Skip to content

Instantly share code, notes, and snippets.

@shairyar
Last active October 13, 2021 09:41
Show Gist options
  • Save shairyar/092bb37822b71de79f94a4c5780feaf0 to your computer and use it in GitHub Desktop.
Save shairyar/092bb37822b71de79f94a4c5780feaf0 to your computer and use it in GitHub Desktop.
Fetching error incident from AppSignal using GraphQL
query IncidentQuery($appId: String!, $incidentNumber: Int!, $sampleId: String, $timestamp: String, $timerange: [DateTime]) {
app(id: $appId) {
id
incident(incidentNumber: $incidentNumber) {
... on ExceptionIncident {
...ExceptionIncident
__typename
}
__typename
}
__typename
}
}
fragment ExceptionIncident on ExceptionIncident {
id
number
lastOccurredAt
actionNames
exceptionName
notificationFrequency
state
namespace
firstBacktraceLine
errorGroupingStrategy
sample(id: $sampleId, timestamp: $timestamp, timerange: $timerange) {
...ExceptionSample
__typename
}
__typename
}
fragment ExceptionSample on ExceptionSample {
id
appId
time
revision
action
namespace
queueDuration
originallyRequested
overview {
key
value
__typename
}
params
sessionData
customData
environment {
key
value
__typename
}
exception {
name
message
backtrace {
original
line
column
path
method
url
type
code {
line
source
__typename
}
error {
class
message
__typename
}
__typename
}
__typename
}
firstMarker {
id
createdAt
shortRevision
revision
gitCompareUrl
user
__typename
}
breadcrumbs {
time
category
action
message
metadata {
key
value
__typename
}
__typename
}
__typename
}
@shairyar
Copy link
Author

query variables

{
  "appId": "YOUR-APP-ID",
  "incidentNumber": ID-OF-INCIDENT,
  "sampleId": "SAMPLE-ID-STRING"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment