question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose query for a partner's orders

See original GitHub issue

I’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:

screen shot 2018-06-19 at 9 46 14 am

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:closed
  • Created 5 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
oxaudocommented, Jun 20, 2018

CMS going WHITE? !!!

0reactions
ashkan18commented, Jul 20, 2018

closing this 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

List of sample queries - Partner Center - Microsoft Learn
This article provides sample queries for the Partner Insights reports. You can use these queries by calling the Create Report Query API ...
Read more >
Relationship Queries | Force.com SOQL and SOSL Reference
You can query the following relationships using SOQL: Query child-to-parent relationships, which are often many-to-one. Specify these relationships directly in ...
Read more >
Partner API | Zapier Platform UI Documentation
The Partner API is the best tool for complete style control over a user's Zapier ... You can customize styling, streamline Zap set-up...
Read more >
IFS REST – Partner operation
The IFS REST - Partner operation defines how to interact with your IFS ... Query – Retrieve one or more records from IFS,...
Read more >
Looker-Based Reporting Solution for External Users
In order to better understand their own business, partners often ... The new solution should allow users to query our database tables and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found