Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Include devOnlyAssignments in the generated module #93

Open
janicduplessis opened this issue Feb 27, 2019 · 0 comments
Open

Include devOnlyAssignments in the generated module #93

janicduplessis opened this issue Feb 27, 2019 · 0 comments

Comments

@janicduplessis
Copy link

janicduplessis commented Feb 27, 2019

It would be nice to be able to use devOnlyAssignments (https://github.com/facebook/relay/blob/f8585ab4f90f2e707d5555c9f7b423de3ea553bd/packages/relay-compiler/language/RelayLanguagePluginInterface.js#L176) to provide the text in dev when using persisted queries.

With my current setup it would make working non-local backends easier since there is no need to upload persisted queries every time queries change when developing.

I was able to hack my local version to produce this:

if (__DEV__) {
  (node as any).params.text = "query ...";
}

I guess we could add a flag to enable this and configure the if dev check or maybe just use process.env.NODE_ENV.

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

No branches or pull requests

1 participant