add QueryRaw to graphql client

This commit is contained in:
Laurent Le Houerou 2024-03-27 08:37:45 +04:00
parent 69254ce05b
commit 2f98cf2f2c

View File

@ -80,6 +80,21 @@ func (c *Client) Query(
return c.gql.Query(ctx, q, variables, options...)
}
func (c *Client) QueryRaw(
ctx context.Context,
q interface{},
variables interface{},
options ...graphql.Option,
) ([]byte, error) {
err := c.rl.Wait(ctx)
if err != nil {
return nil, errors.Wrap(err, "waiting for rate limit")
}
c.lock.Lock()
defer c.lock.Unlock()
return c.gql.QueryRaw(ctx, q, variables, options...)
}
func (c *Client) Mutate(
ctx context.Context,
q interface{},