apollo icon indicating copy to clipboard operation
apollo copied to clipboard

No longer possible to use a relative url

Open PssbleTrngle opened this issue 2 years ago • 1 comments

Environment

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)

PssbleTrngle avatar May 10 '23 12:05 PssbleTrngle

Just faced the same issue but occurs only in server-side for me. Any update on this ?

bgondy avatar Feb 14 '24 19:02 bgondy