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

Unable to update Matrix field using updateViewer Mutation #148

Open
Nic1911 opened this issue Mar 21, 2024 · 1 comment
Open

Unable to update Matrix field using updateViewer Mutation #148

Nic1911 opened this issue Mar 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Nic1911
Copy link

Nic1911 commented Mar 21, 2024

Hi!

I'm trying to update a Matrix field via the updateViewer mutation.

The field has blocks with 3 inner fields (String):

Screenshot 2024-03-21 alle 10 18 03

In GraphQL I'm using the following Mutation:

mutation UPDATE_CART(
    $leathers: [cart_MatrixBlockContainerInput]
) {
  updateViewer(cart: {blocks: $leathers}) {
    id
    ... on User {
      id
      cart {
        ... on cart_leather_BlockType {
          id
          leatherId
        }
      }
    }
  }
}

Then I pass the following variables:

"leathers": [{
  "leather": {
      "id": "919191910" , 
      "leatherId": 5330, 
      "quantity": 100, 
     "collectionId": 5322
   }
}]

I'm also passing an Authorization token JWT and the Mutation runs without errors, but the matrix field is empty.

Does anyone had the same issue?
Thanks in advance and regards,

Nicolò

@Nic1911 Nic1911 changed the title Unable to update User Matrix field using updateViewer Mutation Unable to update Matrix field using updateViewer Mutation Mar 21, 2024
@Nic1911
Copy link
Author

Nic1911 commented Mar 21, 2024

Using the same mutation I'm able to update others fields (String) instead.

Ex.:

mutation UPDATE_USER(
    $firstname: String,
  ) {
    updateViewer(
      firstname: $firstname,
    ) {
      id
    }
  }
{ firstname: "Nic" }

So the issue is limited to the Matrix field.

Thanks

@jamesedmonston jamesedmonston self-assigned this May 16, 2024
@jamesedmonston jamesedmonston added the bug Something isn't working label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants