getVenueByOrgId
talawa-api / resolvers/Query/getVenueByOrgId / getVenueByOrgId
Variable: getVenueByOrgId
> const
getVenueByOrgId: QueryResolvers
["getVenueByOrgId"
]
Retrieves venues associated with a specific organization, with optional filtering and sorting.
This function performs the following steps:
- Constructs the query filter using the
getWhere
helper function based on provided filter criteria. - Determines the sorting order using the
getSort
helper function based on provided sort criteria. - Queries the
Venue
collection in the database to find venues that match the specified organization ID and any additional filter criteria. - Limits the number of results based on the
first
argument and skips results based on theskip
argument. - Sorts the results according to the specified sort criteria.
Param
This parameter is not used in this resolver function but is included for compatibility with GraphQL resolver signatures.
Param
The arguments provided by the GraphQL query, including:
orgId
: The ID of the organization for which venues are being retrieved.where
: Optional filter criteria to apply to the venue query.orderBy
: Optional sorting criteria for the results.first
: Optional limit on the number of results to return.skip
: Optional number of results to skip for pagination.
Returns
A promise that resolves to an array of venues matching the query criteria.