Closed
Description
Presently there is a limitation in Relay that requires that any interpolation you perform in a Relay.QL
block must evaluate to:
-
a fragment reference
${Foo.getFragment('viewer')}
-
an array of fragment references
${COMPONENTS.map(c => c.getFragment('viewer'))}
-
a route-conditional function that returns exactly one fragment reference
${route => COMPONENTS[route].getFragment('viewer')}
The task at hand is to enable the interpolation of route-conditional functions that return an array of fragment references.
${route => COMPONENTS.map(c =>
c.getFragment('treasure').if(variables[`${route}Unlocked`])
)}