Skip to content

Commit 5dae4e9

Browse files
committed
fix: extract recordEvents field from root object in subscription resolver
The resolver was returning the entire root object instead of the recordEvents field within it, causing GraphQL to fail when resolving child fields like uri, type, etc.
1 parent 5a4174f commit 5dae4e9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/graphql/schema/builder.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ func (b *Builder) buildSubscriptionType() *graphql.Object {
156156
},
157157
},
158158
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
159-
// This is called for each event - just return the event
159+
// Extract recordEvents from the root object passed by subscription handler
160+
if m, ok := p.Source.(map[string]interface{}); ok {
161+
return m["recordEvents"], nil
162+
}
160163
return p.Source, nil
161164
},
162165
},

0 commit comments

Comments
 (0)