Breaking change: currently QueryRaw, MutateRaw and Subscribe methods return *json.RawMessage. This output type is redundant to be decoded. The output type should be changed to []byte.
var subscription struct {
Me struct {
Name graphql.String
}
}
subscriptionId, err := client.Subscribe(&query, nil, func(dataValue []byte, errValue error) error {
if errValue != nil {
// handle error
// if returns error, it will failback to `onError` event
return nil
}
data := query{}
err := json.Unmarshal(dataValue, &data)
fmt.Println(query.Me.Name)
// Output: Luke Skywalker
return nil
})
if err != nil {
// Handle error.
}
This also removes canonical/vanity github.com/shurcooL/graphql import path
This PR adds
ExecRaw
method that returns a raw json message.Breaking change: currently
QueryRaw
,MutateRaw
andSubscribe
methods return*json.RawMessage
. This output type is redundant to be decoded. The output type should be changed to[]byte
.This also removes canonical/vanity
github.com/shurcooL/graphql
import path