Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

updateCustomer mutation doesn't update undefined fields #388

Closed
keharper opened this issue Feb 22, 2019 · 1 comment
Closed

updateCustomer mutation doesn't update undefined fields #388

keharper opened this issue Feb 22, 2019 · 1 comment
Assignees
Labels
bug Something isn't working Component: CustomerGraphQl Contribution Day Tickets is good for start on Contribution Day

Comments

@keharper
Copy link
Contributor

keharper commented Feb 22, 2019

The updateCustomer mutation won't add a value to a field that doesn't have a value already.

The functional API tests should also be updated, because this is a basic use case.

Preconditions (*)

  1. Branch 2.3-develop

Steps to reproduce (*)

  1. Create a customer
mutation {
    createCustomer(
        input: {
            firstname: "Melanie"
            lastname: "Shaw"
            email: "mshaw@example.com"
            password: "Password1"
        }
    ) {
        customer {
            id
            firstname
            lastname
            email
        }
    }
}
  1. Generate a customer token

  2. Supply the customer token with the following mutation

mutation {
    updateCustomer(
        input: {
            middlename: "Quincy"
        }
    ) {
        customer {
            firstname
            middlename
            lastname
            
        }
    }
}

Expected result (*)

{
  "data": {
    "updateCustomer": {
      "customer": {
        "firstname": "Melanie",
        "middlename": "Quincy",
        "lastname": "Shaw"
      }
    }
  }
}

Actual result (*)

{
  "data": {
    "updateCustomer": {
      "customer": {
        "firstname": "Melanie",
        "middlename": null,
        "lastname": "Shaw"
      }
    }
  }
}
@naydav naydav added bug Something isn't working Contribution Day Tickets is good for start on Contribution Day labels Feb 22, 2019
@pmclain pmclain self-assigned this Feb 24, 2019
pmclain added a commit to pmclain/graphql-ce that referenced this issue Feb 24, 2019
The current schema defines properties that were ignored when processing user
input.

Fixes magento#388
@naydav naydav closed this as completed Mar 8, 2019
@naydav
Copy link
Contributor

naydav commented Mar 8, 2019

#397

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Component: CustomerGraphQl Contribution Day Tickets is good for start on Contribution Day
Projects
None yet
Development

No branches or pull requests

4 participants