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
Hi,
I open this issue to discuss about the best API for route redirection. I propose an API like addRoute({ path:'/old-path', redirectPath:'/new-path' }), based on discussions in #2091.
We can render a <Redirect/> when we detect the redirectPath prop (see App.jsx in the apollo2 branch, which uses React Router 4), the implementation is trivial.
However, with this we only handle redirection within React router. So, you can setup a "real" redirection. E.g if you had a blog in your Vulcan app, but moved it to another technology/server, you won't be able to redirect to it with this syntax. For example, I could not redirect the /graphiql endpoint, which will disappear with Apollo2, to the new endpoint, because the related routes lives outside the router (GraphQL Playground/GraphiQL are literally new apps within the Vulcan app).
So my questions are:
are you ok with a redirectPath option in the addRoute function?
do you think supporting "real" redirection is worth it? I think they would need another param like external:true to differentiate them from React Router routes.
The text was updated successfully, but these errors were encountered:
Hi,
I open this issue to discuss about the best API for route redirection. I propose an API like
addRoute({ path:'/old-path', redirectPath:'/new-path' })
, based on discussions in #2091.We can render a
<Redirect/>
when we detect theredirectPath
prop (see App.jsx in theapollo2
branch, which uses React Router 4), the implementation is trivial.However, with this we only handle redirection within React router. So, you can setup a "real" redirection. E.g if you had a blog in your Vulcan app, but moved it to another technology/server, you won't be able to redirect to it with this syntax. For example, I could not redirect the
/graphiql
endpoint, which will disappear with Apollo2, to the new endpoint, because the related routes lives outside the router (GraphQL Playground/GraphiQL are literally new apps within the Vulcan app).So my questions are:
redirectPath
option in theaddRoute
function?external:true
to differentiate them from React Router routes.The text was updated successfully, but these errors were encountered: