How can I tell if a variable is an array or an entry/element query? We have some components that are used to build pages, like normal, and some where we hydrate them with other data, so we are passing in arrays instead of entries.

If something is essentially an element, we need to do a .all() to not have deprecation warnings, but if you do that on an array, you get errors. I've read through A similar question with element queries vs arrays but since I'm not explicitly running a query on the page, this isn't quite applicable. 

Both arrays and objects are iterable so that can't distinguish it. Ideally I'd like to do something like this:

{% if props.cards is array %}
    {% set cardArray = props.cards %}
{% else %}
    {% set cardArray = props.cards.all() %}
{% endif %}
{% for card in cardArray %}
...


Obviously, I'd be fine swapping the if/else conditions for the right test case
you can use the instance of twig test here.

You want to flip your logic, so test for Query object first else array stuff but this should work I think.

To get the specific class just {% dd props.cards %} in the template for ease.