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

Option to force on in production #118

Open
adam-thomas-privitar opened this issue Oct 21, 2021 · 0 comments
Open

Option to force on in production #118

adam-thomas-privitar opened this issue Oct 21, 2021 · 0 comments

Comments

@adam-thomas-privitar
Copy link

adam-thomas-privitar commented Oct 21, 2021

Currently, there is no way to force the exchange to work in production. This can be useful when you want to analyse things in production. This has actually been previously discussed on a ticket i created a while ago (on the wrong repo, whoops): urql-graphql/urql-devtools#48.

It was kindly fixed by @JoviDeCroock.

Since then though it looks like the guard on NODE_ENV has returned and theres no way to override it.

It'd probably be annoying for folks to just remove the guard because people might see it unexpectedly start being there in prod (which might be why it came back?), so I understand this is actually not that trivial to fix without major version bump.

Maybe the exchange could have a new init function attached to it which accepts a config object or something?

createClient({
  exchanges: [
    devToolsExchange.init({force: true})
  ]
})

That way you could still use the current behaviour like

createClient({
  exchanges: [
    devToolsExchange
  ]
})

Without changing it for anyone. Alternatively there could be another env var introduced to override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant