如何解决GraphQL - 模型属于特定用户字段
我正在使用 Lighthouse 包来实现 GraphQL,我的应用程序中的用户属于一个实体,我需要获取属于每个用户实体的模型,我的架构暂时是这样的
"A date string with format `Y-m-d`,e.g. `2011-05-23`."
scalar Date @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Date")
"A datetime string with format `Y-m-d H:i:s`,e.g. `2018-05-23 13:43:32`."
scalar DateTime @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime")
type Query {
me: User @auth
execution: [RobotTime!]! @all
}
type RobotTime {
id: ID!
instance: Instance!
robot: Robot!
start: DateTime!
end: DateTime!
}
type Instance {
id: ID!
name: String!
token: String!
}
type Robot {
id: ID!
start_bot: String!
process: Process!
}
type Process {
id: ID!
name: String!
token: String!
}
type User {
id: ID!
name: String!
email: String!
created_at: String!
updated_at: String
}
我已经搜索了文档,但找不到任何可以帮助我完成我需要做的事情的内容。
目前我在控制器中完成了它,我将它作为具有不那么复杂的逻辑的 json 返回,我使用了大约 5 个模型。
抱歉我的英语不好
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。