-
Notifications
You must be signed in to change notification settings - Fork 90
Cannot get response headers #329
Copy link
Copy link
Closed
Labels
Type: SupportAny questions, information, or general needs around the SDK or GitHub APIsAny questions, information, or general needs around the SDK or GitHub APIs
Description
Hi,
I was thinking about client-side request caching to optimize some CLI requests, I would probably need to get the request response headers for that.
Unless I missed something, it looks like there is no way to retrieve the response headers once the Github request.
Is that something that could be done?
Maybe with an option?
Without extended option (as it is currently)
graphql.defaults({
request: {
extendedResponse: false
}
})const data = await graphql(query);
With extended option (what I would need)
graphql.defaults({
request: {
extendedResponse: true
}
})const response = await graphql(query);
const { data, request } = response;
console.log(request.status); // HTTP status
console.log(request.headers); // response headers
console.log(data); // actual response (same as request.data)Any thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: SupportAny questions, information, or general needs around the SDK or GitHub APIsAny questions, information, or general needs around the SDK or GitHub APIs