【发布时间】:2021-09-24 00:52:03
【问题描述】:
非常关注这篇帖子 Adding tags to Gatsby Contentful blog 到 T,但仍然找不到它不起作用的原因...
import React from "react"
import { graphql } from "gatsby"
export const query = graphql`
query($slug: String!, $tag: [String!]) {
contentfulBrunchPost(slug: { eq: $slug }, tag: { in: $tag }) {
title
slug
tag
}
}
`
const TagPost = props => {
return <h1>{props.data.contentfulBrunchPost.title}</h1>
}
export default TagPost
我收到错误“无法读取未定义的属性 'contentfulBrunchPost'”。 graphiQL 在内容和 gatsby 方面非常新,所以指出正确的方向会很棒
【问题讨论】:
标签: reactjs gatsby contentful graphiql