Open robertf224 opened 3 weeks ago
Would love a more complete understanding of what problem(s) we're trying to solve here.
Here's what I'm inferring: The babel plugin currently needs to be able to see the Relay config file in order to apply the correct transformation. This requires:
Am I correct in inferring that this is the set of problems we are trying to solve here?
@captbaritone yeah that's about right. For context I'm working on a nice integration layer right now between Relay and Next.js, but the same idea would apply to any tools building on top of Relay. The two places I'm using loadConfig
are:
pull-schema
cli command that loads environment variables using @next/env
, executes an introspection query using your Relay environment, and saves the schema to the path specified in the schema
field of your Relay configProviding a type-safe/standard library for loading Relay's config file will avoid bugs/hacks in tools building on top of Relay, e.g. see this cli that just hardcodes relay.config.json
and then does a bunch of non-type-safe loading and manipulation on top
I will also port the Babel plugin to use this library in a follow-up!
Adding (or rather reviving) a
relay-config
library for loading/saving Relay configs. Will portbabel-plugin-relay
to use this but hitting "module not found" errors in tests.