Page MenuHomePhabricator

Getting PHID data in one api call
Closed, DuplicatePublic

Description

I have an internal tool that calls out to Phabricator to fetch differential data (via differential.query.) API RTTs are expensive and I'd ideally like to only make one, but I can't even figure out the author's name without doing another query to resolve the user PHIDs.

Assuming I'm not just missing something, I can think of a bunch of different theoretical solutions (from laborious and impractical/long-term to doable):

  • Conduit should be more of a query language (similar to the graphql stuff that facebook posted)
  • Add a new API call that can run two (or more) API calls in a row. It runs one api call, and somehow uses instructions from the caller to feed data from the first api call into the second.
  • Add some hack/kludge that makes the API server resolve PHIDs. This could also be a wrapper API call, so something like
Conduit.doInterestingCall(
  'name': 'differential.query',
  'params': {'ids': my_ids},
  'interestingThingsToDo': ['alsoFetchPHIDs']
);

My guess is that conduit isn't a priority right now, but I don't think you want to pay the maintenance cost of any overly egregious hack. I like the doInterestingCall solution because its practical, honest about being a hack, and will support other people's crazy ideas in a way that doesn't really cause any damage/maintenance issues. Its the PHP way of doing things :P.

Thoughts?

Event Timeline

meitros created this task.Jul 25 2015, 2:03 AM
meitros assigned this task to epriestley.
meitros raised the priority of this task from to Needs Triage.
meitros updated the task description. (Show Details)
meitros added a subscriber: btrahan.