我正在用弹簧靴构建graphql。我很好奇是否可以将类型设置为查询的参数。IE:
type Query {
students:[Student]
studentById(requestModel: RequestModel):Student
}
type RequestModel {
client_id: ID!
api_key: String!
correlation_id: ID!
student: Student!
}
type Student
{
id:ID!
firstName:String
lastName:String
fullName:String
}
如果我要求我的客户在标头中发送 API-KEY 并在 Request_Body 中发送查询,这可行吗?如何捕获 API-KEY?您能否详细说明这种方法是否有效?