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

GraphQL: Add accountCartByAccountId resolver #4427

Merged

Conversation

Projects
None yet
4 participants
@aldeed
Copy link
Member

commented Jul 12, 2018

Resolves #4354
Impact: minor
Type: feature

Changes

Query.accountCartByAccountId now works.

Breaking changes

None

Testing

Make sure the query works and only allows you to access your own cart unless you're an admin

Example full query:

{
  accountCartByAccountId(accountId: "cmVhY3Rpb24vYWNjb3VudDpOR242R1I4TDdEZlduZkdDaA==", shopId: "cmVhY3Rpb24vc2hvcDpKOEJocTN1VHRkZ3daeDNyeg==") {
    _id
      account {
        _id
      }
      createdAt
      shop {
        _id
      }
      updatedAt
      expiresAt
      items {
        nodes {
          _id
          productConfiguration {
            productId
            productVariantId
          }
          addedAt
          attributes {
            label
            value
          }
          createdAt
          isBackorder
          isLowQuantity
          isSoldOut
          imageURLs {
            large
            small
            original
            medium
            thumbnail
          }
          metafields {
            value
            key
          }
          parcel {
            length
            width
            weight
            height
          }
          price {
            amount
            displayAmount
            currency {
              code
            }
          }
          priceWhenAdded {
            amount
            displayAmount
            currency {
              code
            }
          }
          productSlug
          productType
          quantity
          shop {
            _id
          }
          title
          variantTitle
          optionTitle
          updatedAt
        }
      }
  }
}
@aldeed

This comment has been minimized.

Copy link
Member Author

commented Jul 12, 2018

This is based off #4412 and should not be merged until that is.

@aldeed aldeed self-assigned this Jul 12, 2018

@aldeed aldeed requested a review from willopez Jul 12, 2018

@willopez willopez added this to the Isolation milestone Jul 12, 2018

@willopez

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

@aldeed code works, I am able to get a cart by accountId + shopId and code looks good. There are some tests failing, from what I can see they are not related to this PR. If that is the case, this is good to go.

@aldeed

This comment has been minimized.

Copy link
Member Author

commented Jul 13, 2018

Tests passed on rerun. This is good to merge after #4412 is merged

@willopez
Copy link
Member

left a comment

👍 LGTM

@spencern

This comment has been minimized.

Copy link
Member

commented Jul 20, 2018

@willopez can you do another quick confirmation on this since the release has changed so much since you last approved?

@spencern spencern changed the base branch from feat-4355-aldeed-create-cart-mutation to release-1.14.0 Jul 20, 2018

@willopez

This comment has been minimized.

Copy link
Member

commented Jul 20, 2018

@spencern currently blocked by reaction client bug, discussed in eng-core. I believe this issue is related: #4438

@aldeed

This comment has been minimized.

Copy link
Member Author

commented Jul 23, 2018

@willopez This should be unblocked now

@aldeed aldeed requested review from willopez and nnnnat and removed request for willopez Jul 23, 2018

@nnnnat

nnnnat approved these changes Jul 23, 2018

Copy link
Member

left a comment

This looks good. Was able to pull cart by user id in GraphiQL and checkout as a registered user in the meteor

@nnnnat nnnnat merged commit f792e73 into release-1.14.0 Jul 23, 2018

10 of 11 checks passed

License Compliance 6 issues found
Details
WIP ready for review
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: docker-build Your tests passed on CircleCI!
Details
ci/circleci: docker-push Your tests passed on CircleCI!
Details
ci/circleci: dockerfile-lint Your tests passed on CircleCI!
Details
ci/circleci: eslint Your tests passed on CircleCI!
Details
ci/circleci: snyk-security Your tests passed on CircleCI!
Details
ci/circleci: test-app Your tests passed on CircleCI!
Details
ci/circleci: test-unit Your tests passed on CircleCI!
Details
security/snyk - package.json (Reaction Commerce) No manifest changes detected

@spencern spencern deleted the feat-4354-aldeed-graphql-accountCartByAccountId branch Jul 25, 2018

@spencern spencern referenced this pull request Aug 8, 2018

Merged

Release 1.14.0 #4338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.