graphql - 带有“gatsby-source-sanity”的图像资产上缺少“固定”和“流动”字段
问题描述
我正在尝试使用gatsby-source-sanity
和从 Sanity 获取图像gatsby-image
。在过去,我fluid
像这样查询图像资产没有问题:
export const query = graphql`
query {
allSanityPicture {
nodes {
image {
asset {
fluid(maxWidth: 900) {
...GatsbySanityImageFluid
}
}
}
}
}
}
`;
但是,由于某种原因,fluid
和的fixed
字段asset
没有出现在 GraphQL 中:
节点上肯定有图像,因为该url
字段有效。
我已经根据需要安装并配置了我的 Gatsby 插件:
plugins: [
{
resolve: `gatsby-source-sanity`,
options: {
projectId: `mhlt1wid`,
dataset: `production`,
token: process.env.SANITY_TOKEN,
}
},
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
],
并使用sanity graphql deploy
.
我在这里想念什么?现在已经在两个新项目上从头开始尝试了两次,但仍然遇到同样的问题。
解决方案
推荐阅读
- r - 如何从表中提取只执行一次活动的人
- eclipse - 如何解决 NoClassDefFoundError?
- optimization - 优化带边界的简单函数时出现索引错误
- python - AttributeError:“_UnixSelectorEventLoop”对象没有属性“_signal_handlers”
- javascript - 用 Javascript 合并重叠区间
- linux - 尝试使用配置脚本时的奇怪行为
- python - 在其他两个保守字符串之间提取字符串并允许 python 或 R 中的不匹配
- c# - 使用 WinSpool 时如何设置页面大小
- javascript - 仅在特定元素而不是整个窗口/文档上使用 getSelection?
- python - 在没有 numpy 的情况下从头开始实现相关矩阵时出现 Keyerror