Skip to content

Commit

Permalink
Merge branch 'master' into graphql-operation-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed May 3, 2023
2 parents 3e9dc3a + 1741410 commit 80b93d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Unit tests

on:
pull_request:
push:
paths:
- "**.go"
Expand Down
10 changes: 10 additions & 0 deletions subscriptions_transport_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ func (stw *subscriptionsTransportWS) OnMessage(ctx *SubscriptionContext, subscri
switch message.Type {
case GQLError:
ctx.Log(message, "server", GQLError)
var errs Errors
jsonErr := json.Unmarshal(message.Payload, &errs)
if jsonErr != nil {
subscription.handler(nil, fmt.Errorf("%s", string(message.Payload)))
return nil
}
if len(errs) > 0 {
subscription.handler(nil, errs)
return nil
}
case GQLData:
ctx.Log(message, "server", GQLData)
var out struct {
Expand Down

0 comments on commit 80b93d0

Please sign in to comment.