1

I Could not find if there is or there isn't a query to get list of shippings methods available via graphql. ref: https://devdocs.magento.com/guides/v2.4/graphql/

Is there a query available?

1 Answer 1

0

Try This:

{
  cart(cart_id: "YOUR_CART_ID") {
    email
    shipping_addresses {
      available_shipping_methods {
        amount {
          currency
          value
        }
        available
        carrier_code
        carrier_title
        method_code
        method_title
        price_excl_tax {
          value
          currency
        }
        price_incl_tax {
          value
          currency
        }
      }
      selected_shipping_method {
        amount {
          value
          currency
        }
        carrier_code
        carrier_title
        method_code
        method_title
      }
    }
  }
}

NOTE: Magento 2.4.X

7
  • I understand this is in the docs, but I did not want to create any orders or and empty cart, I just needed a list of enabled/available shipping methods. Maybe I'll have to create a custom graph API Aug 8, 2022 at 16:20
  • 1
    @JulianoVargas Yes you need to create a custom GraphQL API.
    – Msquare
    Aug 9, 2022 at 1:16
  • Getting Error : { "messages": { "error": [ { "code": 500, "message": "Fatal Error: 'Allowed memory size of 792723456 bytes exhausted (tried to allocate 67108872 bytes)' in '/var/www/html/m2/vendor/magento/zendframework1/library/Zend/Db/Select.php' on line 1004", "trace": "Trace is not available." } ] } } Jun 28, 2023 at 11:23
  • Please increase your memory limit, or you can enable developer mode in your store. Then you can go network tab and check your graphql response. And you can also add some log-in files to check code flow.
    – Msquare
    Jun 28, 2023 at 11:27
  • Yes that also tried nothing in log file. Also increased memory limit. Jun 28, 2023 at 11:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.