apollo
apollo copied to clipboard
No longer possible to use a relative url
Environment
- Operating System: Windows_NT
- Node Version: v18.13.0
- Nuxt Version: 3.4.3
- Nitro Version: 2.3.3
- Package Manager: [email protected]
- Builder: vite
- User Config: modules, postcss, css, nitro, build, apollo, i18n, formkit, tailwindcss, typescript
- Runtime Modules: ./modules/assets, @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @formkit/[email protected], @nuxtjs/[email protected]
- Build Modules: -
Describe the bug
In previous versions, it was possible to use a relative httpEndpoint url.
In development, this could get redirected using the nitro proxy.
With the newest release, I now get the error Failed to parse URL from /api/graphql
Expected behaviour
A relative url should also be a viable input for the httpEndpoint property
Reproduction
apollo.config.ts
export default defineApolloClient({
httpEndpoint: '/api/graphql'
})
next.config.ts
...
nitro: {
devProxy: {
'/api': 'http://localhost:8080/api',
},
},
Additional context
No response
Logs
500
Failed to parse URL from /api/graphql
at C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\@apollo\client\core\QueryManager.js:679:19
at both (C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\@apollo\client\utilities\observables\asyncMap.js:17:53)
at C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\@apollo\client\utilities\observables\asyncMap.js:10:72
at new Promise ()
at Object.then (C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\@apollo\client\utilities\observables\asyncMap.js:10:24)
at Object.error (C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\@apollo\client\utilities\observables\asyncMap.js:18:49)
at notifySubscription (C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\zen-observable\lib\Observable.js:140:18)
at onNotify (C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\zen-observable\lib\Observable.js:179:3)
at SubscriptionObserver.error (C:\Users\niwi\Desktop\Repos\Personal\Atlas\node_modules\zen-observable\lib\Observable.js:240:7)
Just faced the same issue but occurs only in server-side for me. Any update on this ?