You are reading content from Scuttlebutt
@mix.exe %UyxtQ0kkcsM0zo6SxgBAeRnJf8VZqwSSdUEgrs6qu+0=.sha256
Re: %zNy8kL7NL

or without await, perhaps even nicer:


async function getPersonMinimal (_, profileId) {
  // make a Promise (so we can return some thing)
  return new Promise((resolve, reject) => {
    // set a our query *ready* to be run
    const runQuery = (done) => {
      apollo.query(getPersonMinimal(profileId))
        .then(res => {
          if (res.errors) reject(res.errors) // graphql errors
          else resolve(res.data.person)
        })
        .catch(err => reject(err)) // network errors
        .finally(done)
    }

    queue.push(runQuery)
  })
}
Join Scuttlebutt now