GraphQL - Return the Size of an Array Field?

@matthewmcneely

I’m trying to expand upon what was done above and running into an issue. I’ve added a location code and trying to add a second parameter “in_location_code” to the function. Do you happen to see what I have wrong here:

Updated schema:

type Guest {
  id: ID!
  guest_name: String
  location_code: !String
  guest_visit_dates: [DateTime]
}

Updated custom DQL resolver:

type Query {
  queryGuestsByMinVisits(visits: Int!, in_location_code: String!): [Guest] @custom(dql: """
    query q($visits: int, $in_location_code: String) {
        var(func: type(Guest)) {
            {
                visitCount as count(Guest.visit_dates)
            }
        }

        queryGuestsByMinVisits(func: uid(visitCount)) @filter(eq(Guest.location_code, $in_location_code)) @filter(ge(val(visitCount), $visits))  {
             id: uid
	         guest_name: Guest.guest_name
		     guest_visit_dates: Guest.guest_visit_dates
		     guest_visit_count: val(visitcount)
        }
    }
        """
    )
}

When I look at the function in GraphiQL, it looks like it’s defined properly, but when I run the query, I receive:

resolving queryGuestsByMinVisits failed because Dgraph query failed because Dgraph execution failed because Type \"String\" not supported.

Thank you