urql-graphql / urql-devtools

A tool for monitoring and debugging urql during development
https://formidable.com/open-source/urql/docs/advanced/debugging/#devtools
MIT License
257 stars 11 forks source link

to support adding headers when sending the introspection query #398

Closed Albert-Gao closed 2 years ago

Albert-Gao commented 2 years ago

Hi

the introspection query to the server is failing, because the whole endpoint is protected, is there anyway we can add the support of adding headers when sending the introspection query? thanks :)

or if we can support local schema #397 , that this feature would not be needed :)

andyrichardson commented 2 years ago

Hey @Albert-Gao, thanks for opening this.

Having the ability to pass the schema to the exchange (like with the cache exchange) sounds like a useful feature 👍

RE adding headers, you could add an exchange just before the fetch exchange which adds headers to the fetchOptions object. This would ensure introspection requests triggered by any exchange would have the headers included

andyrichardson commented 2 years ago

I'm going to close this because an intercepting exchange could do the job (drop a comment if you need help with this).

Will keep #397 around - open to contributions 👍