Skip to content

Commit

Permalink
Merge pull request #46 from wp-graphql/misc-fixes-4
Browse files Browse the repository at this point in the history
Scaffold archive
  • Loading branch information
josephfusco authored Jan 8, 2024
2 parents a87cb8a + 89eda6d commit 76b4a6d
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions wp-templates/archive.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
import { gql } from '@apollo/client'
import Head from 'next/head'

import { LayoutArchive } from '@/components/LayoutArchive'

export const Archive = (props) => {
const { data } = props

const { node } = data

if (!node) {
return null
}

return (
<>
<h1>Archive</h1>
<pre>{JSON.stringify(props, null, 2)}</pre>
<Head>
<title>{`${data?.node?.name} - WPGraphQL for ACF`}</title>
</Head>
<LayoutArchive
title={data?.node?.name ? data.node.name : 'Archive'}
data={data}
navigation={data?.navigation?.nodes}
>
{/* <pre>{JSON.stringify(props, null, 2)}</pre> */}
</LayoutArchive>
</>
)
}

Archive.query = gql`
query GetArchiveFieldType($uri: String!) {
query GetArchive($uri: String!) {
node: nodeByUri(uri: $uri) {
__typename
uri
... on ContentType {
label
}
... on TermNode {
name
}
... on Category {
posts {
nodes {
Expand Down

1 comment on commit 76b4a6d

@headless-platform-by-wp-engine

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the recent updates to your Atlas environment:

App Environment URL Build
acf.wpgraphql.com main https://hb…wered.com ✅ (logs)

Learn more about building on Atlas in our documentation.

Please sign in to comment.