Not sure if this helps but this is the code I have in my backend and have been using to query the Contacts:
export function getContactInfo ( memNum ) {
const options = {
suppressAuth : true
};
return contacts . queryContacts ()
. eq ( “info.extendedFields.custom.member-number” , memNum )
. find ( options )
. then (( queryResults ) => {
const items = queryResults . items ;
return items ;
})
. catch (( error ) => {
console . error ( error );
});
}
If you are testing on your live site and you do not have the suppressAuth setting correct, you won’t get results. Or if you have site membership setup and your user is not logged in.