Skip to content
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

How do i add custom headers when using a local url schema? #177

Open
anthonyhoegberg opened this issue Aug 21, 2024 · 1 comment
Open

How do i add custom headers when using a local url schema? #177

anthonyhoegberg opened this issue Aug 21, 2024 · 1 comment

Comments

@anthonyhoegberg
Copy link

I need to add auth headers to my url, how could i do this using the apollo.config.js file?

@phryneas
Copy link
Member

You can add a headers object to your client service configuration:

module.exports = {
  client: {
    service: {
      name: "my-graphql-app",
      url: "http://localhost:4000/graphql",
      headers: {
        "your-header": "header-value"
      }
    },
  },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants