Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Feature: redirections #2096

Open
eric-burel opened this issue Oct 4, 2018 · 0 comments
Open

Feature: redirections #2096

eric-burel opened this issue Oct 4, 2018 · 0 comments

Comments

@eric-burel
Copy link
Contributor

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants