jeddeloh / rescript-apollo-client

ReScript bindings for the Apollo Client ecosystem
MIT License
126 stars 18 forks source link

Link headers #117

Closed dkruk closed 3 years ago

dkruk commented 3 years ago

Hello. I have issue with HttpLink headers.

Using this example from the documentation, I created a link to my GraphQL endpoint.

let httpLink = ApolloClient.Link.HttpLink.make(
  ~uri=_ => Env.graphqlEndpoint,
  ~headers=Obj.magic({"Accept": "application/json"}),
  (),
)

I expect the Accept header to be exactly application/json, but */* is automatically added to the value. image

This is a bug? If not, how can this be fixed?

Thank you!

jeddeloh commented 3 years ago

I think this is actually a question for Apollo Client, not this library. We just provide some types and integration with graphql-ppx other headers are working normally. That said, I googled for examples and only ever see people using lowercase accept. It's a long shot, but have you tried this?

dkruk commented 3 years ago

@jeddeloh thanks for your reply

This is very strange, but it works! Thank you!

I close this issue.