Last active
December 11, 2019 05:25
-
-
Save aanoaa/6370d9755d245fe8dc8a74c979acd850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import { graphql } from "gatsby" | |
import Layout from "../components/layout" | |
import SEO from "../components/seo" | |
const Product = ({ data }) => ( | |
<Layout> | |
<SEO title={data.wordpressWpProduct.title} /> | |
<h1>{data.wordpressWpProduct.edges[0].title}</h1> | |
<p>{data.wordpressWpProduct.edges[0].excerpt}</p> | |
</Layout> | |
) | |
export default Product | |
export const postQuery = graphql` | |
query($id: String!) { | |
allWordpressWpProduct(filter: { id: { eq: $id } }) { | |
edges { | |
node { | |
id | |
title | |
excerpt | |
date(formatString: "YYYY-MM-DD") | |
link | |
slug | |
} | |
} | |
} | |
} | |
` |
const Product = ({ data }) => {
const p = data.wordpressWpProduct;
const first = p.edges[0];
return (
<Layout>
<SEO title={p.title} />
<h1>{first.title}</h1>
<p>{first.excerpt}</p>
</Layout>
);
};
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
원하는거