You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At Pinterest, we have performance issues for queries with large ASTs. This relates to our backend, and isn't a Relay problem.
We have a global variable isAuth, and frequently do ...AuthFragment @include(if: $isAuth) or ...UnauthFragment @skip(if: $isAuth)
This provides great DevEx, but also results in a query containing both AuthFragment and UnauthFragment. These queries end up timing out, and causing problems.
We can work around this by having two queries: query MyAuthQuery { ...SomeRootFragment @arguments(isAuth: true) } and vice versa for unauth.
This is doable, but it also means that we have to use @arguments and @argumentDefinitions everywhere for
So my feature request is that relay allows you to hard code certain query variables: query MyAuthQuery($isAuth: Boolean! @hardCodedTo(value: true)) or MyAuthQuery($isAuth = true) (though this gets away from GraphQL syntax), and have the skip_unreachable_node transform drop the relevant fragments from the normalization AST.
Cheers!
The text was updated successfully, but these errors were encountered:
isAuth
, and frequently do...AuthFragment @include(if: $isAuth)
or...UnauthFragment @skip(if: $isAuth)
AuthFragment
andUnauthFragment
. These queries end up timing out, and causing problems.query MyAuthQuery { ...SomeRootFragment @arguments(isAuth: true) }
and vice versa for unauth.@arguments
and@argumentDefinitions
everywhere forSo my feature request is that relay allows you to hard code certain query variables:
query MyAuthQuery($isAuth: Boolean! @hardCodedTo(value: true))
orMyAuthQuery($isAuth = true)
(though this gets away from GraphQL syntax), and have theskip_unreachable_node
transform drop the relevant fragments from the normalization AST.Cheers!
The text was updated successfully, but these errors were encountered: