Skip to content

Conversation

@aldeed
Copy link
Contributor

@aldeed aldeed commented Aug 20, 2018

Resolves #4563
Impact: breaking
Type: feature

Changes

  • Creates a new setEmailOnAnonymousCart GraphQL mutation. Same behavior as the "cart/setAnonymousUserEmail" Meteor method
  • The "cart/setAnonymousUserEmail" Meteor method is removed
  • The place in checkout where the "cart/setAnonymousUserEmail" Meteor method was called now calls the setEmailOnAnonymousCart GraphQL mutation using the Apollo client.
  • Updated the React Blaze template to include the Apollo client provider.
  • Added a new Meteor method, "getOpaqueIdFromInternalId", that can be used to transform IDs from internal to opaque from client code. This is done as a Meteor method because once everything is converted to use GraphQL data instead of Meteor publications, this will no longer be necessary. It is a temporary bridge between older Meteor code and newer code that uses GraphQL.

Breaking changes

The "cart/setAnonymousUserEmail" Meteor method is removed. This does not break any core behavior, but it might require updates to any custom plugins.

Testing

  • Add items to a cart as an anonymous user (not logged in), and then check out. Choose to check out as guest, and then verify that you can successfully enter an email address and the checkout advances to the next step. This email address form is the only UX change.
  • Verify that you can use GraphQL to set the cart email address.
mutation SetEmailOnAnonymousCart($input: SetEmailOnAnonymousCartInput!) {
  setEmailOnAnonymousCart(input: $input) {
    cart {
       _id
       email
    }
  }
}

Variables:

{ input: { cartId, email, token } }

@aldeed aldeed self-assigned this Aug 20, 2018
@aldeed aldeed added this to the Kit Carson milestone Aug 20, 2018
@aldeed aldeed requested a review from mikemurray August 20, 2018 21:22
Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

👍

@mikemurray mikemurray merged commit 30cbdf6 into release-1.15.0 Aug 20, 2018
@mikemurray mikemurray deleted the feat-aldeed-graphql-setEmailOnAnonymousCart branch August 20, 2018 22:50
@spencern spencern mentioned this pull request Aug 22, 2018
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