-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Using relative url with next.js api routes #484
Comments
Sorry for not replying to this for so long. I don't think this has anything to do with urql. Most likely you're trying to use an absolute URL on the server-side which won't work? Could that be? If your API is on the same server as the app, it may be worth to create a small |
Closed due to inactivity. |
I would like to ask this again. My problem is, that I am using next.js api routes for my graphql server, so my api routes are on the same domain. My application has a subdomain for every user and it would make things much easier if every subdomain would send requests to their "own" api routes, so that cookies get passed accordingly |
I also wonder about this. Why can't we pass a relative URL to urql?
I'm curious about this. I get the idea, but is there an example somewhere? I'm not too sure about how to create/use a |
Typically this should work but I never looked into this because of the lack of reproductiveness without spinning up a full Next project for this. The |
Alright, I'll try again tonight. Yesterday I couldn't wrap my head around what you meant with "a small fetchExchange". Tried a few things, but didn't get anywhere. Indeed the code must run on the server (initiated through Next's |
Hey @dsebastien if you can make a small example in https://codesandbox.io/ I'm up to take a look |
It's alright. I was just using it wrong ;-) |
I am not a 100% sure if this restriction comes from urql, but it only allows absolute urls. When using next.js api routes it hinders me from an easier config, since I could theoretically just pass
'/api/graphql'
as urlThe text was updated successfully, but these errors were encountered: