Query to get all survey categories.
A Promise that resolves to an array of Category objects.
This query retrieves all survey categories, including their associated surveys.
Query to get a specific survey category by ID.
The ID of the category to fetch.
A Promise that resolves to a Category object if found, or null if no category is found.
This query retrieves a specific survey category by its ID, along with its associated surveys.
Mutation to create a new survey category.
The context object that contains the currently authenticated user.
A Promise that resolves to the newly created Category object.
This mutation allows an admin user to create a new survey category. The category will be associated with the admin user.
Mutation to delete an existing survey category.
The ID of the category to delete.
The context object that contains the currently authenticated user.
A Promise that resolves to the deleted Category object, or null if the category could not be found or deleted.
This mutation allows an admin user to delete an existing survey category. Only the admin can delete categories. If the user is not an admin, the mutation will not be executed.
Mutation to update an existing survey category.
The ID of the category to update.
The context object that contains the currently authenticated user.
A Promise that resolves to the updated Category object, or null if the category could not be found or updated.
This mutation allows an admin user to update an existing survey category. Only the admin can update categories. If the user is not an admin, the mutation will not be executed.
CategoryResolver
Description
Handles all survey category-related GraphQL mutations and queries.