vtex-apps / store-graphql

GraphQL schema and resolvers for the VTEX Commerce Stores API
78 stars 45 forks source link

identify address by id and update name #652

Closed beatrizmaselli closed 1 year ago

beatrizmaselli commented 1 year ago

What problem is this solving?

When updating the addressName of an address, it was not matching the old address and was creating a new address. Now when updating an addressName using the id of the address, the name field in the address of the V2 profile is updated.

Now there is a variable called name in addition to addressName. The addressName can still be written if you wish, but you have to remember that it is the identifier so my recommendation is to let it be a random key.

The name should represent at the address of ProfileV2 a friendly name for the use and addressName is the same key identification used at the address inside ProfileV1 for the system.

How to test it?

Use the mutation updateAddress

[Workspace](Link goes here!)

Screenshots or example usage:

image
mutation {
  updateAddress(id: "id of address", fields: {name: "nem name"}) {
    userId
    addresses {
      id
      name
      addressName
      receiverName
    }
  }
}
vtex-io-ci-cd[bot] commented 1 year ago

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

vtex-io-docs-bot[bot] commented 1 year ago

Beep boop :robot:

I noticed you didn't make any changes at the docs/ folder

In order to keep track, I'll create an issue if you decide now is not a good time

vtex-io-ci-cd[bot] commented 1 year ago

Your PR has been merged! App is being published. :rocket: Version 2.163.0 → 2.164.0

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.store-graphql@2.164.0

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. :book: