Wp-graphql-woocommerce: Bugs with Checkout Mutation input variables

Created on 29 Apr 2020  路  1Comment  路  Source: wp-graphql/wp-graphql-woocommerce

Describe the bug

I'm experiencing the following issues when it comes to input variables on the checkout mutation.

  1. shipping / billing address objects appear to be saved to the customer's file in WooCommerce when overwrite is unspecified, and even when overwrite: false is explicitly specified as an input variable.

  2. company input string is not saved to the order even if it's specified as an input variable.

  3. customer notes appears to be a field accessible in the WC backend that has no corresponding front end input value. It is accessible when you edit the shipping address on the order (pen icon).

To Reproduce
Steps to reproduce the behavior:

  1. Create a checkout mutation with overwrite: false, overwrite: null or simply excluding overwrite altogether from the mutation. Upon checking the customer in wp-admin, the address has been overwritten by the one used in the last checkout mutation.
mutation CHECKOUT {
  checkout(input: {
    clientMutationId: "some-unique-id",
    shipping: {address1: "234 Placeholder Drive", overwrite: false},
    billing: {address1: "123 New Address Street"}}) {
      clientMutationId
      ...
    }
}

In either case, the address1 value is updated on the user's file.

  1. Create a checkout mutation with company: "string" as an input variable in either shipping, billing, or both address objects. Upon checking the order in wp-admin, the address does not contain the company name specified during the checkout mutation.
mutation CHECKOUT {
  checkout(input: {
    clientMutationId: "some-unique-id",
    shipping: {company: "ACME Inc"},
    billing: {company: "ACME Inc"}}) {
      clientMutationId
      ...
    }
}
  1. Customer Notes - N/A - new feature request? Let me know if this requires its own issue.

Expected behavior

  1. shipping and billing address objects ought to respect the overwrite flag.

  2. company ought to be written to the order.

  3. Ought to be able to add a customer note as an input variable when creating a checkout mutation.

Additional context

wp-graphql 0.6.0
wp-graphql-woocommerce 0.4.2

I can test this on latest versions of each, but I scanned the open issues and did not see anything related to fixes around these bugs. Let me know, thanks!

bug needs more discussion

Most helpful comment

@ardiewen The customerNote field was simply forgotten :man_facepalming: I've remedied these bugs here, and the changes will be included the upcoming v0.5.1 release.

>All comments

@ardiewen The customerNote field was simply forgotten :man_facepalming: I've remedied these bugs here, and the changes will be included the upcoming v0.5.1 release.

Was this page helpful?
0 / 5 - 0 ratings