Query to retrieve a specific survey answer by ID.
A Promise resolving to a Answers
object, or null
if not found.
This query returns a single survey answer with its related question and answered record.
Query to retrieve all survey answers.
A Promise resolving to an array of Answers
objects.
This query fetches all answers submitted for survey questions, including their relations to the corresponding question and the record of who answered.
Mutation to create a new answer to a survey question.
The input data for the new answer, including the selected value and the question ID.
The context containing the currently authenticated user.
A Promise resolving to the newly created Answers
object.
This mutation allows a user (or admin) to submit an answer to a survey question. The answer is automatically linked to the authenticated user.
AnswersResolver
Description
Handles all GraphQL queries and mutations related to survey answers, as well as tracking which users answered which surveys.