Skip to content

Cannot get response headers #329

@soundstep

Description

@soundstep

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: SupportAny questions, information, or general needs around the SDK or GitHub APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions