Expose query for a partner's orders
See original GitHub issueI’ve started work on the /orders
page in Volt. This is the page where we draw a table of orders for the partner. It has tabs at the top for the various states. The partner can review the orders and pick one to view the detail page. It looks something like this:
In order to move forward, I’m hard-coding an order id in the Rails controller and hitting the existing order query.
What we’ve talked about is exposing an orders query where you pass a partner id and then get back a list of the orders for that partner.
To draw this table, I’d want to issue a query to MP like this:
{
orders(partner_id: "abc123", type: "open") {
id
updated_at
state
total
line_items {
id
artwork {
id
inventory_id
artists {
id
name
}
}
}
}
}
I’d pass in a partner id and a type and then get back an array of orders.
I mentioned the tabs on this page, so I’d need something for that too - maybe another query, something like this:
{
orders_count(partner_id: "abc123") {
type
count
}
}
And then I’d combine these queries when drawing this page.
ORRRR
Would it be better to draw this page with all orders returned? What if I left off the type part of that first query - I’d expect to get all orders for the partner regardless of type. If I could do that, then I wouldn’t need the orders_count
query. I’m wondering if this is a better way to go because it should result in fewer requests to the server. More data in the return, but less chatty. Seems like a win.
One last thing I’d like to bring up is the concept of orders being read/unread. The comp shows a purple unread indicator next to some of the orders and I don’t think we’ve talked about this yet.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (13 by maintainers)
Top GitHub Comments
CMS going WHITE? !!!
closing this 👍