childImageSharp๊ฐ ์๊พธ null์ด๋ผ๊ณ ๋จ๋ค์..ใ
ํด๋น index.tsx์ ์ฝ๋๋ ์๋์ ๊ฐ์ต๋๋ค. ๊นํ๋ธ์๋ ์์ง ์
๋ก๋ ํ์ง ์์๋๋ฐ, ๋ณด์๊ณ ๋ง์ฝ ๋ ํ์ํ์๋ฉด ๊นํ๋ธ์ ์
๋ก๋ํ ๊ฒ์! ----- import React, { FunctionComponent } from 'react'; import styled from '@emotion/styled'; import GlobalStyle from '../components/Common/GlobalStyle'; import Introduction from '../components/Main/Introduction'; import CategoryList from '../components/Main/CategoryList'; import Footer from '../components/Common/Footer'; import PostList, { PostType } from '../components/Main/PostList'; import { ProfileImageProps } from '../components/Main/ProfileImage'; import { graphql } from 'gatsby'; interface IndexPageProps { data: { allMarkdownRemark: { edges: PostType[]; }; file: { childImageSharp: { fluid: ProfileImageProps['profileImage']; }; }; }; } const CATEGORY_LIST = { All: 5, Web: 3, Mobile: 2, }; const Container = styled.div` display: flex; flex-direction: column; height: 100%; `; const IndexPage: FunctionComponent = function ({ data: { allMarkdownRemark: { edges }, file: { childImageSharp: { fluid }, }, }, }) { return ( ); }; export default IndexPage; export const queryPostList = graphql` query queryPostList { allMarkdownRemark( sort: { order: DESC, fields: [frontmatter___date, frontmatter___title] } ) { edges { node { id frontmatter { title summary date(formatString: "YYYY.MM.DD.") categories thumbnail { childImageSharp { fluid( maxWidth: 768 maxHeight: 200 fit: INSIDE quality: 100 ) { ...GatsbyImageSharpFluid_withWebp } } } } } } } file(name: { eq: "profile-image" }) { childImageSharp { fluid(maxWidth: 120, maxHeight: 120, fit: INSIDE, quality: 100) { ...GatsbyImageSharpFluid_withWebp } } } } `;