icssc / anteater-api

API that provides easy access to public data from UC Irvine. Developed for Anteaters, by Anteaters.
https://anteaterapi.com/reference
GNU Affero General Public License v3.0
3 stars 0 forks source link

feat: add rest and graphql endpoints for study rooms #29

Open sanskarm7 opened 1 week ago

sanskarm7 commented 1 week ago

Description

Created GraphQL and REST endpoints to provide study room data, namely:

Added description and directions fields to the studyRoomById endpoint to provide more details for each specific room.

Related Issue

resolves issue #2

Motivation and Context

These endpoints provide structured access to study room data in both REST and GraphQL formats, fulfilling the requirements outlined in issue #2. These changes allow users to access study room details as a whole, retrieve data for a specific room, or filter rooms based on criteria like location and capacity. This functionality is essential for making study room data available through the API in a scalable and flexible way.

How Has This Been Tested?

Tested locally on a development server using Postman. Verified:

REST Endpoints:

Access to /v2/rest/study-rooms/all returns all rooms. Access to /v2/rest/study-rooms/{id} returns data for a specific room by ID. Access to /v2/rest/study-rooms with query parameters returns filtered results.

GraphQL Queries:

Querying allStudyRooms returns a list of all study rooms with the expected fields. Querying studyRoom(id: "") returns details for a specific room, including description and directions if they are present. Querying studyRooms(query: { location: "Science Library", capacityMin: 4 }) returns filtered results based on location and capacity.

Types of changes

Checklist:

ecxyzzy commented 1 week ago

Oh also as a side note please make sure to make the PR name compliant with conventional commits before merging. Thanks :+1: