Hi @artsycoder ,
We have a guide on how to create and manage carts with the storefront API in our developer documentation here.
For most use cases it’s recommended to create and manage a cart, then redirect a customer to the Shopify checkout at the cart’s checkoutUrl. There is also a Hydrogen, Headless, and Storefront APIs board in the forums for more specific questions about how to manage your headless storefront.
The cart query on the Storefront API’s query root is what you are using above, and can only retrieve cart objects. You are correct that there is no checkout query on the Storefront API, but a checkout object implements the node interface so it can be queried directly like this if necessary:
query checkoutNode($id: ID!){
node(id:$id){
...on Checkout{
id
webUrl
}
}
}
variables:
{
"id":"gid://shopify/Checkout/95fc07e10e53218fdba96451e45f4eeb?key=58af8673d32769d7e82e3f5ec8fa6dee"
}
Hope that helps!
- James