You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get access to the query/mutation parameters inside mapped type #521
How can query/mutation parameters be accessed inside a mapped type?
I'll give some real examples. There's a query:
query {
feedback(classId:"41reqda11") {
questions {
answers {
id
answer
}
studentAnswers {
id
answer
}
}
}
}
and the mapped type:
/** * @Type(class=Question::class) * @SourceField(name="answers") */class QuestionType
{
/** * @return Answer[] */
#[Field, Logged, Right(User::ROLE_STUDENT)]
publicfunctiongetStudentAnswers(
Question$question
): array {
// I need an access to the query parameter "classId" right here
}
}
So I need to get all answers answered by the student for the given class. To do this, I need to know the classId. How can I fetch classId parameter?
Activity