Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce BindResponseHeaders option #163

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

hgiasac
Copy link

@hgiasac hgiasac commented Feb 14, 2025

close #161

Introduce a new BindResponseHeaders option to retrieve response headers via binding.

headers := http.Header{}
err := client.Query(context.TODO(), &q, nil, graphql.BindResponseHeaders(&headers))
if err != nil {
  panic(err)
}

fmt.Println(headers.Get("content-type"))
// application/json

Copy link

github-actions bot commented Feb 14, 2025

Code Coverage

Package Line Rate Health
github.com/hasura/go-graphql-client 68%
github.com/hasura/go-graphql-client/ident 100%
github.com/hasura/go-graphql-client/pkg/jsonutil 84%
Summary 73% (1433 / 1973)

Minimum allowed line rate is 60%

@hgiasac hgiasac merged commit 3b34c44 into master Feb 14, 2025
2 checks passed
@hgiasac hgiasac deleted the feat/bind-response-headers branch February 14, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting headers from Response
1 participant