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

Cors issue with Apollo client #11325

Closed
kod-man opened this issue Oct 29, 2023 · 3 comments
Closed

Cors issue with Apollo client #11325

kod-man opened this issue Oct 29, 2023 · 3 comments

Comments

@kod-man
Copy link

kod-man commented Oct 29, 2023

Hi. I have a question about Cors.

I have a login mutation.

const LOGIN_USER = gql`
  mutation ($email: String!, $password: String!) {
    auth_login(email: $email, password: $password) {
      access_token
      refresh_token
    }
  }
`;

My index setup here:

const client = new ApolloClient({
  uri: 'https://ufuk.site/graphql/system',  cache: new InMemoryCache()
});

But I am getting Cors issue
cors1

If I convert my code to this ( which I found somewhere )

const client = new ApolloClient({
  link: new HttpLink({
     uri: 'https://ufuk.site/graphql/system',
    fetchOptions: {
      mode: 'no-cors'
    }
  }),
  cache: new InMemoryCache()
});

I got another error.

cors2

Can someone help me to fix it?

@hunginf
Copy link

hunginf commented Oct 29, 2023

Same with me on nextjs (_ _!)

@bignimbus
Copy link
Contributor

Hi @kod-man and @hunginf 👋🏻 thanks for opening/commenting on this Issue! Without more information I doubt we can narrow down the specific issue in your application code. There's nothing here to indicate a bug in Apollo Client so I'm going to close this - thanks for understanding 🙏🏻 I would like to invite you to join our Discord and/or our Forum to ask questions like these, and I encourage you to share as much information as you can in order to get high-quality answers. Thanks!

@bignimbus bignimbus closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants