Skip to content

Commit 5e69ee4

Browse files
committed
feat(breadcrumbs): add Breadcrumb and related enums to event type definitions
- Introduced BreadcrumbLevel and BreadcrumbType enums for categorizing breadcrumbs. - Added Breadcrumb type to represent events leading up to errors, including fields for timestamp, type, category, message, severity level, and associated data. - Updated EventPayload to include a breadcrumbs field for tracking chronological events before an error.
1 parent 47936e2 commit 5e69ee4

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

src/typeDefs/event.ts

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,64 @@ type EventUser {
116116
photo: String
117117
}
118118
119+
"""
120+
Breadcrumb severity level
121+
"""
122+
enum BreadcrumbLevel {
123+
fatal
124+
error
125+
warning
126+
info
127+
debug
128+
}
129+
130+
"""
131+
Breadcrumb type - controls categorization and UI appearance
132+
"""
133+
enum BreadcrumbType {
134+
default
135+
request
136+
ui
137+
navigation
138+
logic
139+
error
140+
}
141+
142+
"""
143+
Single breadcrumb entry - represents an event that occurred before the error
144+
"""
145+
type Breadcrumb {
146+
"""
147+
Timestamp when the breadcrumb occurred (Unix timestamp in milliseconds)
148+
"""
149+
timestamp: Float!
150+
151+
"""
152+
Type of breadcrumb - controls UI categorization
153+
"""
154+
type: BreadcrumbType
155+
156+
"""
157+
Category of the event - more specific than type
158+
"""
159+
category: String
160+
161+
"""
162+
Human-readable message describing the event
163+
"""
164+
message: String
165+
166+
"""
167+
Severity level of the breadcrumb
168+
"""
169+
level: BreadcrumbLevel
170+
171+
"""
172+
Arbitrary key-value data associated with the breadcrumb
173+
"""
174+
data: JSONObject
175+
}
176+
119177
"""
120178
Type representing Event payload
121179
"""
@@ -174,6 +232,11 @@ type EventPayload {
174232
Custom data provided by project users
175233
"""
176234
addons: EncodedJSON
235+
236+
"""
237+
Breadcrumbs - chronological trail of events before the error
238+
"""
239+
breadcrumbs: [Breadcrumb!]
177240
}
178241
179242
@@ -337,9 +400,9 @@ type Subscription {
337400
"""
338401
Sends new events from all user projects
339402
"""
340-
eventOccurred: Event!
403+
eventOccurred: Event!
341404
}
342-
405+
343406
"""
344407
Event information per day with these events
345408
"""
@@ -453,7 +516,7 @@ extend type Mutation {
453516
Mark to set
454517
"""
455518
mark: EventMark!
456-
): Boolean!
519+
): Boolean!
457520
458521
"""
459522
Namespace that contains only mutations related to the events

0 commit comments

Comments
 (0)