-
Notifications
You must be signed in to change notification settings - Fork 122
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
Feature Request: Pluggable 'Headers' API Implementation #279
Comments
Generally speaking, the Headers API is supposed to be fully supported -- except on IE -- and IE needs lots of hacks anyhow, so patching in a Polyfill there should be the norm. (Note: iOS Safari does support it, no idea why can-i-use is wrong there) Would you mind elaborating more why you want this feature @basicdays? -- The I don't expect that this would be a crazy difficult feature to add, but I'd love to have a specific use-case before adding more configuration hooks like this. |
That's definitely true if running the code only in browsers. However if |
It looks like Apollo Client v3 kind of expected that kind of environment with this code: https://github.com/apollographql/apollo-client/blob/main/src/link/http/checkFetcher.ts#L3 |
@basicdays I had definitely not considered using apollo-link-rest much from the server-side-rendering side of things. -- If you're doing SSR I guess I imagined you could stand up an ApolloServer that reads from a REST source. I wouldn't heavily object to a configuration option like this for that purpose, but I don't recommend we make it pluggable for every endpoint -- if you want to implement this, I'd accept a PR that allows configuration at the Link-Level (parallel to |
In this case, I'm using it in a CLI tool to work with the Github Actions CI, since half of their API is in GraphQL, and half of it is still in Rest. I'd agree that doing it at the Side note, I apologize about the influx of issues. I figured it was better to at least report them than just workaround them on my own. :) |
When possible, tests are appreciated -- we do have tests for many common situations. That said, we don't have integration tests, so something like this No problem re: filing tickets, reporting them is the only way we can keep track of what people care about or need support for! |
Hello all 👋
I'm currently trying out
apollo-link-rest
via a node script, and ran into issues with how it expects to useHeaders
class off of the global object. I'm currently using thecross-fetch
package to pull in afetch
ponyfill and passing it into theRestLink
constructor via thecustomFetch
option. However there doesn't seem to be a way to do that with theHeaders
object as well. I'm currently just fully polyfilling theHeaders
class on the global object, but would like to be able to pass it in via the constructor on acustomHeaders
option instead.Proposal:
Workaround:
For the sake of easily replicating this, I've added a repository that reproduces this: https://github.com/basicdays/ghtest
The text was updated successfully, but these errors were encountered: