【发布时间】:2021-09-30 01:53:19
【问题描述】:
我正在使用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 个模型。
对不起我的英语不好
【问题讨论】:
-
向我们展示您在控制器中所做的事情。
标签: laravel graphql laravel-lighthouse