Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

No branches or pull requests

2 participants