Select documents using multiple ids

I’m trying to figure, if it’s even possible, to use an array of ids to select multiple documents. Fauna actually accepts this schema but when I try to use it, it fails with the message:

Scalar expected, Array provided.

allCollectionByIds(collectionID: [ID!], type: FormulationType): [FormulationCollection!]

query {
      allCollectionByIds(collectionID: ["286331148573868550"]) {
        after
        before
        data {
            _id
            votes {
                data {
                    ownerID
                    value
                }
            }
            formulations {
                data {
                    _id
                    name
                }
            }
        }
    }
}

Any idea if this is possible? I tried to create resolver but I didn’t manage to get it to work as I have a few relations for this type.

type FormulationCollection {
    type: FormulationType!
    status: FormulationStatus
    questID: ID!
    formulations: [Formulation!] @relation
    quest: Quest!
    votes: [Vote!] @relation
    collectionID: ID
}

Hi @baboons and welcome!

How did you write your resolver?
A very basic function might be something like that:

 CreateFunction(
  {
    name:"getDocs",
    body: Query(
        Lambda('docArray',Map(Var('docArray'),Lambda('doc',Get(Ref(Collection("products"), Var('doc'))))))
      )
  }
)

which returns:

Call(Function('getDocs'),["284903573683175937","284903573683176961","284903573683177985"])
[ { ref: Ref(Collection("products"), "284903573683175937"),
    ts: 1607967948090000,
    data:
     { product_name: 'Dextromathorphan HBr',
       supplier: 'Schmitt-Weissnat',
       quantity: 2,
       unit_cost: '$20.53' } },
  { ref: Ref(Collection("products"), "284903573683176961"),
    ts: 1607967965340000,
    data:
     { product_name: 'sildenafil citrate',
       supplier: 'Wisozk Inc',
       quantity: 5,
       unit_cost: '$10.47' } },
  { ref: Ref(Collection("products"), "284903573683177985"),
    ts: 1607967980405000,
    data:
     { product_name: 'Mountain Juniperus ashei',
       supplier: 'Keebler-Hilpert',
       quantity: 1,
       unit_cost: '$8.74' } } ]

In case this doesn’t work for you, may you provide all details related to your schema?

Thanks,
Luigi