Skip to content

Instantly share code, notes, and snippets.

@fourjuaneight
Created January 18, 2020 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourjuaneight/3cb7030b01f5463e70caecd53b6f1240 to your computer and use it in GitHub Desktop.
Save fourjuaneight/3cb7030b01f5463e70caecd53b6f1240 to your computer and use it in GitHub Desktop.
// src/templates/products.js
export const query = graphql`
query ProductQuery($id: String!) {
cosmicjsProducts(id: { eq: $id }) {
content
metadata {
id
image {
imgix_url
url
}
price
}
slug
title
}
}
`;
const ProductListing = ({ data, location }) => (
<Layout location={location}>
<Product product={data.cosmicjsProducts} url={location.href} single />
</Layout>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment