Reactjs 盖茨比映像失败的prop类型

Reactjs 盖茨比映像失败的prop类型,reactjs,graphql,gatsby,Reactjs,Graphql,Gatsby,我试着把我的WP帖子的特色图片放到帖子站点上。我遵循了教程,现在我能够在网站上看到特色图片,但我也得到了以下警告: index.js:2177 Warning: Failed prop type: Invalid prop `fixed` supplied to `Image`. in Image (at BlogPost.js:17) in BlogPostTemplate (created by HotExportedBlogPostTemplate) in AppC

我试着把我的WP帖子的特色图片放到帖子站点上。我遵循了教程,现在我能够在网站上看到特色图片,但我也得到了以下警告:

index.js:2177 Warning: Failed prop type: Invalid prop `fixed` supplied to `Image`.
    in Image (at BlogPost.js:17)
    in BlogPostTemplate (created by HotExportedBlogPostTemplate)
    in AppContainer (created by HotExportedBlogPostTemplate)
    in HotExportedBlogPostTemplate (created by PageRenderer)
    in PageRenderer (at json-store.js:93)
    in JSONStore (at root.js:51)
    in RouteHandler (at root.js:73)
    in div (created by FocusHandlerImpl)
    in FocusHandlerImpl (created by Context.Consumer)
    in FocusHandler (created by RouterImpl)
    in RouterImpl (created by Context.Consumer)
    in Location (created by Context.Consumer)
    in Router (created by EnsureResources)
    in ScrollContext (at root.js:64)
    in RouteUpdates (at root.js:63)
    in EnsureResources (at root.js:61)
    in LocationHandler (at root.js:119)
    in LocationProvider (created by Context.Consumer)
    in Location (at root.js:118)
    in Root (at root.js:127)
    in _default (at app.js:65)
BlogPost.js文件:

// src/templates/BlogPostTemplate.js
import React from "react"
import { graphql } from "gatsby"
import Img from "gatsby-image"
import Layout from "../components/layout"
import SEO from "../components/seo"
const BlogPostTemplate = ({ data }) => (
  <Layout>
    <SEO
      title={data.wordpressPost.title}
      description={data.wordpressPost.excerpt}
    />
    <h1>{data.wordpressPost.title}</h1>
    <p>
      Written by {data.wordpressPost.author.name} on {data.wordpressPost.date}
    </p>
    <Img
      fixed={data.wordpressPost.featured_media.localFile.childImageSharp.fixed}
      alt={data.wordpressPost.title}
      style={{ maxHeight: 450 }}
    />
    <div
      style={{ marginTop: 20 }}
      dangerouslySetInnerHTML={{ __html: data.wordpressPost.content }}
    />
  </Layout>
)
export default BlogPostTemplate
export const query = graphql`
  query($id: Int!) {
    wordpressPost(wordpress_id: { eq: $id }) {
      title
      content
      excerpt
      date(formatString: "MMMM DD, YYYY")
      author {
        name
      }
      acf {
        work_name
      }
      featured_media {
        localFile {
          childImageSharp {
            fixed(width: 300, height: 300) {
              src
              width
              height
            }
          }
        }
      }
    }
  }
`

我搜索了这类问题,似乎这不是常见的事情。希望这里有人能帮上忙。
提前谢谢

这个问题的答案是从。我用错了。它必须是这样的:

childImageSharp {
    fixed(width: 300, height: 300) {
        ...GatsbyImageSharpFixed
    }
}
childImageSharp {
    fixed(width: 300, height: 300) {
        ...GatsbyImageSharpFixed
    }
}