-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: implement redirect query #1746
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 881ee90:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Did you check schema.org to see if we can rename or rearrange redirect query args in a more agnostic way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'm only now realizing the return type of the query is String. This doesn't scale well, as it prevents any other additions in the future. I think we should change it to an object that can be of type Thing. It has an url
field and, in the future, I see us using the identifier
field to specify the status code of the redirect. I can also evolve into any other parent type, as it would be a very generic one for now.
What's the purpose of this pull request?
This PR adds a query to solve redirects when performing a search.
In case of VTEX platform, this is solved by the IS api.
How it works?
When performing a search if a term or facet has a redirect, the value of the
redirect
field should be an URL; this can later be used to redirect the user to an internal or external URL.From VTEX admin:
It get solved as:
How to test it?
@faststore/api
package individually./admin/search/v4/redirects/
tech
PR related at vtex-sites: vtex-sites/nextjs.store#382
PR related 2.x: #1749