The 400 error usually is an indication of an error in the JS. I think the problem is that guest_visit_dates.size. The lambda server logs errors to stderr. Maybe have a look.
If you can see the logs, put a console.log(parent) in there. If parent.guest_visit_dates is present, then you should be able to simply return parent.guest_visit_dates.length. If it’s not present (I can’t recall if lists of scalars are present in Lambda invocations) I can help you with a graphql query in there.