menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team

Is there anything wrong with Origin header in HttpLink?

July 1, 2020 at 11:25pm

Is there anything wrong with Origin header in HttpLink?

July 1, 2020 at 11:25pm (Edited 1 month ago)
Hi,
I ran into an issue where a query to my apollo server was failing on Vercel when using Static Site Generation (via getStaticProps). During build, the request would return a 500 error.
I have managed to fix this by simply adding an origin header in my httplink, like so:
const httpLink = new HttpLink({
uri: 'https://api.myDomain.net',
credentials: 'include',
headers: {
Origin: 'https://myDomain.net' // <- This fixed the issue
}
})
I was wondering though, is there anything wrong with this? It seems too simple and makes me wonder if there is an underlying issue with regards to this working as I have not seen this solution anywhere.
Thanks
No messages yet