【问题标题】:Gatsby childImageSharp resolutions settingsGatsby childImageSharp 分辨率设置
【发布时间】:2019-03-14 20:39:50
【问题描述】:

我正在使用 Gatsby graphyQl 设置 childImageSharp 分辨率质量。 当我运行 gatsby develop 时,出现此错误。

错误:GraphQLError:高度应为正整数,但 收到类型号的 414.17910447761193

我的图形查询将此作为其中的一部分。

   localFile {
        childImageSharp {
          resolutions(height: 200, quality: 60) {
            ...GatsbyImageSharpResolutions_withWebp_noBase64
          }
        }
      }

我正在传递一个正的高度值。任何人都知道为什么我会得到这个?

【问题讨论】:

    标签: gatsby


    【解决方案1】:

    如果有帮助,这对我有用,你可能想试试。

     {
         allFile {
            edges {
              node {
                childImageSharp {
                   fluid(maxWidth:1000){
              ...GatsbyImageSharpFluid_noBase64
            }
                }
    
              }
            }
          }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      相关资源
      最近更新 更多