Right now, you are required to use a named export to export field definitions (i.e. the export is required in export something = iso`field Query.foo ...`).
This isn't ideal! We don't want anyone else directly importing that iso literal. (Tests should be able to only via Isograph.)
So, what we should do is to:
disallow exports of iso literals (can we, without parsing the AST?) Maybe the babel plugin can do this.
and transform the iso declaration into export OPAQUE_NAME = ParameterPassedToIsoLiteral. At least this would cause a syntax error if you already tried to export it, or assign it to a variable.
this will probably cause random errors to show up in the generated reader.ts files, which isn't ideal.
export something = iso`field Query.foo ...`
).export OPAQUE_NAME = ParameterPassedToIsoLiteral
. At least this would cause a syntax error if you already tried to export it, or assign it to a variable.This would be awesome!