How to query multiple document refs in GraphQL

Var("input") should be the array passed in, it looks like you are trying to use it like an object.

If you’re a “console.log enthusiast” You can check that with an Abort:

Update(Function('get_multiple_decors'), {
  body: Query(
    Lambda(
      ['input'],
      Abort(Format('%@', [Var('input')]))
    )
  )
})

// call from shell
Call(Function("get_multiple_decors"), [["111", "222", "333"]])

In any case, have you tried to use just the variable by itself? Jay left in a couple of typos for you to work out – really make sure you know what you’re doin’ :wink: :yum:

// ...
  data: Map(
    Var("get_multiple_decors"),  // <= note wrapped in `Var` function
    Lambda("x", Get(Ref(Collection("User"), Var("x"))))
  )
// ...

Otherwise, it looks like you’re doing it right :slight_smile:

1 Like