我们可以编写如下查询解析器层
@DgsData(parentType = "Query", field = "answersByQuestionUuid")
public List<Answer> answersByQuestionUuid(@InputArgument("questionUuid") UUID questionUuid,
@InputArgument("enhancedContent") boolean enhancedContent,
@InputArgument("templateName") String templateName) {
if (enhancedContent) {
return getStructuredAnswersByQuestionUUID(questionUuid.toString(), templateName);
}
return getAnswersByQuestionUUID(questionUuid);
}
如何在解析器中获取 HTTP 标头。