Skip to content

Allow creating a billing address#188

Merged
kennyadsl merged 1 commit intomasterfrom
waiting-for-dev/billing_address_creation
Sep 21, 2021
Merged

Allow creating a billing address#188
kennyadsl merged 1 commit intomasterfrom
waiting-for-dev/billing_address_creation

Conversation

@waiting-for-dev
Copy link
Copy Markdown
Contributor

Adds a new field addressType to the input type for saveInAddressBook mutation.

When not given, it defaults to shipping and behaves just like before.
However, when it's billing a billing address is created.

Example:

mutation addAddress {
  saveInAddressBook(input: {
    address: {
        name: "Alice"
        address1: "1 E-commerce Rd."
        city: "LA"
        countryId: "U3ByZWU6OkNvdW50cnktMjMz"
        zipcode: "36666"
        phone: "222222"
        stateId: "U3ByZWU6OlN0YXRlLTM0Mzk="
    },
    addressType: billing,
    default: true
  }) {
    errors {
      path
      message
    }
    user {
      billAddress {
        name
      }
    }
  }
}

Response:

{
  "data": {
    "saveInAddressBook": {
      "errors": [],
      "user": {
        "billAddress": {
          "name": "Alice"
        }
      }
    }
  }
}

Adds a new field `addressType` to the input type for `saveInAddressBook` mutation.

When not given, it defaults to `shipping` and behaves just like before.
However, when it's `billing` a billing address is created.

Example:

```graphql
mutation addAddress {
  saveInAddressBook(input: {
    address: {
        name: "Alice"
        address1: "1 E-commerce Rd."
        city: "LA"
        countryId: "U3ByZWU6OkNvdW50cnktMjMz"
        zipcode: "36666"
        phone: "222222"
        stateId: "U3ByZWU6OlN0YXRlLTM0Mzk="
    },
    addressType: billing,
    default: true
  }) {
    errors {
      path
      message
    }
    user {
      billAddress {
        name
      }
    }
  }
}
```

Response:

```json
{
  "data": {
    "saveInAddressBook": {
      "errors": [],
      "user": {
        "billAddress": {
          "name": "Alice"
        }
      }
    }
  }
}
```
Copy link
Copy Markdown
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kennyadsl kennyadsl merged commit 1ea45e9 into master Sep 21, 2021
@waiting-for-dev waiting-for-dev deleted the waiting-for-dev/billing_address_creation branch September 21, 2021 11:04
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