A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
This API recently stopped working: https://shopify.dev/api/admin-rest/2022-07/resources/order-risk#get-orders-order-id-risks
Orders that are high risk are having risk level returned [].
Actually in testing, all orders are now returning [] for OrderRisk, Shopify is not returning risk level even on orders that show high risk in the Shopify admin.
I've tried in both REST and GraphQL, using the lates 2022-07 (and other versions), and the shopify_api_ruby gem 11.1.0.
Here are the requests:
# REST
risks = ShopifyAPI::OrderRisk.all(order_id: order_id)
puts risks # []
# GraphQL
query = <<~GQL
query($items_count: Int, $order: ID!) {
order(id: $order) {
risks {
level
message
}
}
}
GQL
Has anyone experienced this or know how to fix it?
@JoesIdeas have you figured out this? I am having the same issue.
@remy727 ya we had to change the way API calls were made for certain calls (like order risks).
So instead of risks = ShopifyAPI::OrderRisk.all(order_id: order_id), we now do something like this:
client = ShopifyAPI::Clients::Rest::Admin.new(session: session)
risks = client.get(path: "/admin/api/2022-07/orders/#{order_id}/risks.json")