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

chore(api): improve attachments performance #1317

Merged
merged 2 commits into from
May 25, 2022
Merged

Conversation

icazevedo
Copy link
Contributor

What's the purpose of this pull request?

This PR improves attachments overall architecture. Related to #1304

How it works?

This PR organizes additionalProperty a little bit better, adds propertyID to PropertyValues (which improves client-side performance) and fixes an inconsistency regarding attachments on the validateCart mutation.

How to test it?

JSON variables of the graphql query to the validateCart mutation:

{
  "cart": {
    "order": {
      "orderNumber": "911b0ceef77e4b98b9ca250a5d2fab2b",
      "acceptedOffer": [
        {
          "price": 602.78,
          "listPrice": 834.97,
          "seller": {
            "identifier": "1"
          },
          "quantity": 1,
          "itemOffered": {
            "sku": "2000586",
            "image": [
              {
                "url": "http://storeframework.vtexassets.com/arquivos/ids/177382/assumenda.jpg?v=637753139967300000",
                "alternateName": "hic"
              }
            ],
            "name": "Bells add-ons",
            "additionalProperty": [
              {
                "name": "1-3-lines",
                "value": "{\"Line 1\":\"1\",\"Line 2\":\"2\",\"Line 3\":\"3\"}",
                "valueReference": "ATTACHMENT"
              }
            ]
          }
        }
      ]
    }
  }
}

Starters Deploy Preview

https://github.com/vtex-sites/nextjs.store/pull/47
vtex-sites/gatsby.store#53

References

This PR improves on #1304 by moving the propertyID computation to the backend

@icazevedo icazevedo requested a review from a team as a code owner May 25, 2022 00:05
@icazevedo icazevedo self-assigned this May 25, 2022
@vercel
Copy link

vercel bot commented May 25, 2022

Deployment failed with the following error:

Resource is limited - try again in 10 minutes (more than 100, code: "api-deployments-free-per-day").

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 25, 2022

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 12fd2a2:

Sandbox Source
Store UI Typescript Configuration

@vercel
Copy link

vercel bot commented May 25, 2022

Deployment failed with the following error:

Resource is limited - try again in 3 minutes (more than 100, code: "api-deployments-free-per-day").

@icazevedo icazevedo merged commit afd304e into main May 25, 2022
@icazevedo icazevedo deleted the chore/improve-attachments branch May 25, 2022 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants