- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在努力构建一个简单的 Facebook 克隆来积累我对 GraphQL 的了解。我正在使用 lighthouse-php在 Laravel 之上为我的数据提供服务。本质上,一个用户有很多 friend ,我知道这是可行的,因为在 Tinker 控制台中,我可以使用 $user->friends()->get()
之类的东西返回正确的数据。我正在努力弄清楚如何传递一组数据。
在我的前端,我有一个 Vuetify 组合框(基本上是一个选择下拉列表),它构建了一个电子邮件数组,这就是我试图传递给我的后端突变的内容。
我如何构造类型和变异以使其接受电子邮件数组?
user.graphql:
extend type Mutation @guard(with: ["api"]) {
addFriends(input: [AddFriendsInput]! @spread): [User]! @field(resolver: "UserMutator@addFriends")
}
type User {
id: ID!
email: String!
password: String!
first_name: String
last_name: String
created_at: DateTime!
updated_at: DateTime!
friends: [User]! @belongsToMany(relation: "friends")
}
input AddFriendsInput {
email: String!
}
addFriend.gql:
mutation AddFriends($friends: [AddFriendsInput]!) {
addFriends(input: { email:[$friends] }){
id
email
}
}
最佳答案
好吧,终于明白了。
将输入修改为:
input AddFriendsInput {
email: String!
# friends: [User]
}
并将我的 Mutation 更改为:
mutation AddFriends($friends: [AddFriendsInput]!) {
addFriends(input: $friends) {
id
email
}
}
这让我现在可以将一系列电子邮件传递给我的解析器。
关于graphql - Lighthouse GraphQL - 如何将数组作为变量传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64977845/
我想在身份验证墙后面运行 Lighthouse 审计。例如,下面我尝试使用 PageSpeed Insights 将 Lighthouse 运行到通常解析为我的 Gmail 帐户的 URL。但是,如下
我可以在同一个突变上插入多个吗? 我想知道这是否存在。 这是我的架构 type Test { id: ID name: String msg: String } input t
在学习 TWA 时,大多数谷歌教程都在 Playstore、Myntra.com(Myntra lite)、NavbharathTimes 中给出了 oyorooms.com 的 OyoLite 应用
我在灯塔中定义了一个查询: extend type Query { products(input: ListInput @spread): [Product] @field(r
我想要将 Azure 订阅加入到我的租户中。为此,我使用 subscriptionDeploymentSchema 创建了一个 ARM 模板。如果我从门户打开此模板,系统会提示我选择一个区域。有什么方
几天前,我在 blob 存储中使用带有 ARM 模板的服务主体来吸引客户,然后客户访问了以下 URL: https://portal.azure.com/#create/Microsoft.Templ
问题描述: 海中有许多灯塔。海的范围是[1, 10^7] × [1, 10^7]。 每个灯塔都可以照亮西南和东北地区。光的力量足以覆盖任何距离。 如果灯塔A和B都在照亮区,说明它们可以互相照亮。 输入
前言 工欲善其事,必先利其器。了解完性能指标之后,性能优化的目标已经明确了。接下来我们借助一些性能测量工具,明确网站距离优化目标还有多大的差距,我将用3篇文章分别介绍3款主流的
正如标题所说,我正在尝试为我在本地提供的 nuxt 应用程序生成报告。如果我通过 DevTools 生成报告,则需要花费很长时间并且给我的评分非常差(与在部署的同一站点上生成报告相比)。 如果我尝试使
我正在努力构建一个简单的 Facebook 克隆来积累我对 GraphQL 的了解。我正在使用 lighthouse-php在 Laravel 之上为我的数据提供服务。本质上,一个用户有很多 frie
我们网站上的页面的 CLS 一直接近于零。这是有道理的,因为它们是服务器呈现的 HTML 页面,具有简单的静态布局。 最近我们添加了 content-visibility: auto 的使用,如下所示
以下是三个顶级网站的 Chrome Lighthouse 得分:优步、爱彼迎和必胜客。测试是在选择 Mobile 的情况下进行的: 分数似乎与实际的移动页面加载速度不匹配 - 对于像这样的顶级高流量网
我 build 了我的第一个 渐进式网页应用 (PWA) 在 react js 中。当我点击 生成报告 在 DevTools 中 Chrome 的审核选项卡上,它显示消息灯塔正在永远升温。 我的 ch
我正在使用 Google Lighthouse 来计算性能得分。标准之一是缓存静态 Assets ,例如图像和脚本。 我无法控制所有这些,但我可以控制缓存的那些已设置为 30 天。但是,Lightho
使用如下所示的架构,是否可以执行查询并按 name 对结果进行排序? JobType 的属性(property)实体?我想要一个分页的工作列表,并按字母顺序显示按工作类型名称排序的结果。 extend
我需要对一个网站进行全面审核,但我想知道是否有任何方法可以让 Lighthouse 做到这一点。我知道他们不支持完整的站点审计或多个 URL,但我发现它可以通过使用 bash 脚本来完成。因此,我将不
任何人都可以告诉我如何使用 lighthouse graphql 订阅,我按照此处的说明执行了所有步骤 https://lighthouse-php.com/3.1/extensions/subscr
在我的 graphql API 中,我必须通过两个不同的因素来授权对字段的请求。用户是否有权访问数据或数据是否属于用户。例如,用户应该能够看到自己的用户数据,所有拥有管理员权限的用户也应该能够看到这些
在我的 graphql API 中,我必须通过两个不同的因素来授权对字段的请求。用户是否有权访问数据或数据是否属于用户。例如,用户应该能够看到自己的用户数据,所有拥有管理员权限的用户也应该能够看到这些
我正在按照 Lighthouse 网站上的教程学习主版本 (4.1)。 https://lighthouse-php.com/4.1/getting-started/tutorial.html#ins
我是一名优秀的程序员,十分优秀!