-
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(api): add attachments #1304
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
* feat: validate cart with attachments * feat: improve get id * Add attachment type Co-authored-by: Ícaro Azevedo <icazevedo10@gmail.com>
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 4134943:
|
parseValue: toObjectOrString, | ||
serialize: stringify, |
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.
I didn't get it, does the ouptut will be always a string, either a string or a stringified object?
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.
It is always a string, but it can be a regular string eg. "hello world"
or and stringified object "{"key": "value"}"
@icazevedo great job, I left some comments that may affect this PR. |
What's the purpose of this pull request?
This PR adds support for attachments on FastStore API. Attachments are a way to customize a product. If a product is added to the cart with a different attachment, a new offer should be created for it. An offer should be considered the same as another one if and only if the attachments (and its value) are also equal.
How it works?
The attachments are included under the
additionalProperty
field, where they can be filtered throughvalueReference
comparison. They are received in the same format they're sent.How to test it?
JSON variables of the graphql query to the validateCart mutation:
Starters Deploy Preview
https://github.com/vtex-sites/nextjs.store/pull/47
vtex-sites/gatsby.store#53