vtex-apps / store-graphql

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

add addressName logic #651

Closed beatrizmaselli closed 1 year ago

beatrizmaselli commented 1 year ago

What problem is this solving?

Casino has a custom my orders page leveraging our Graphql interface. The idea is to allow the user to select the addressName to use labels for addresses saved as "home", "apartment", "work" etc.

Currently, the saveAddress query receives the addressName argument, but the value sent is ignored and a random key is created. Now we have the possibility to create those labels respecting the rule at the front end level:

How to test it?

You can link this version and run the graphql. I´m using Casino account that is PII (profile V2):

mutation {
  saveAddress(address:{
    receiverName:"Maselli Beatriz",
    geoCoordinates: [],
    addressType:"residential",
    addressName: "Bibi",
    city:"Teste",
    complement:"Teste4",
    country:"FRA",
    neighborhood:null,
    postalCode:"75001",
    reference:null,
    state:"Teste",
    street:"Teste"
  }){
    addressId
    addressName
    receiverName
  }
}

[Workspace](Link goes here!)

Create new address with addressName: image

Update address:

image

image

Create address without passing the addressName:

image

Editing this address:

image

image

Testing at my address in a Profile V1 account:

[[Workspace](Link goes here!)

image

image

How does this PR make you feel? :link:

![](put .gif link here - can be found under "advanced" on giphy)

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.

github-actions[bot] commented 1 year ago
Warnings
:warning: Changes were made to package.json, but not to yarn.lock - Perhaps you need to run `yarn install`?

Generated by :no_entry_sign: dangerJS against 3dde57fae3a1c657d84529477cc415e60106e856

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

Your PR has been merged! App is being published. :rocket: Version 2.161.3 → 2.162.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.162.0

After that your app will be updated on all accounts.

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