JS client: Let returns [null] while working fine in Shell

Hi,

I have the following query which is working fine:

Map(
  Paginate(
    Match(
      Index('invoicesByUser'),
      Select('ref', Get(Match(Index('userByEmail'), email))),
    ),
  ),
  Lambda('InvoiceRef', Get(Var('InvoiceRef')))
)

But when I try to format the result using Let - it returns [null]:

Map(
  Paginate(
    Match(
      Index('invoicesByUser'),
      Select('ref', Get(Match(Index('userByEmail'), email))),
    ),
  ),

  Lambda(
    'InvoiceRef',
    Let(
      { InvoiceDoc: Get(Var('InvoiceRef')) },
      {
        info: Select(['data', 'info'], Var('InvoiceDoc')),
        clients: Select(['data', 'client'], Var('InvoiceDoc')),
        items: Select(['data', 'items'], Var('InvoiceDoc')),
        user: Get(Select(['data', 'user'], Var('InvoiceDoc'))),
      },
    ),
  ),
)

Still, this query works fine in Shell.
I’ll appreciate any help!
Thanks.

How are you using the query outside of the shell? It sounds like you’re working directly with the js client (based on the title). Can you include the code that you use to call the query as well?

The online shell works on an admin role. Are there ABAC rules on the JS client key/token?

Oh, I found an issue, it was in my JS code after I execute the query.
Thanks a lot for the quick response!