1

I have tried this Magento2/vendor/magento/module-quote-graph-ql/etc/schema.graphqls

type Mutation {
placeOrder(input: PlaceOrderInput): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder")
}

input PlaceOrderInput {
    cart_id: String!
    anonymousId: String
}

Request:

mutation {
  placeOrder(
    input: {
      cart_id: "6tGj0vqL9VZ5FhyIySaHSIUaqmEFbyHm",
      anonymousId: "6tGj0vqL9VZ5FhyIySaHSIUaqmEFbyHm"
    }
  ) {
    order {
      order_number
    }
  }
}

But its not working with error Unknown argument "anonymousId" on field "placeOrder" of type "Mutation

5
  • any thoughts on this ?
    – devhs
    Commented May 17, 2021 at 10:01
  • 1
    Your code looks fine. Make sure you run compile command after this change. Check with Altair tool once. I have tried the similar case with mutation "createEmptyCart" and it works fine.. Commented May 17, 2021 at 11:01
  • I have just run cache clean, let me check after run compile command
    – devhs
    Commented May 17, 2021 at 11:04
  • Thanks @PratikNavapara, for the comment, let me check
    – devhs
    Commented May 17, 2021 at 11:04
  • anonymous_id vs anonymousId?
    – sv3n
    Commented May 17, 2021 at 20:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.