Querying a custom type

I am trying to query a custom type 'Article' but when viewing the page in the local dev site I am getting slice zone is empty when the document is not empty. I have copied exactly how the page query works but not getting any results.

`import { Client } from '../../prismic'
import SliceZone from 'next-slicezone'
import { useGetStaticProps, useGetStaticPaths } from 'next-slicezone/hooks'

import resolver from '../../sm-resolver.js'

const Article = (props) => <SliceZone {...props} resolver={resolver} />

// Fetch content from prismic
export const getStaticProps = useGetStaticProps({
client: Client(),
uid: ({ params }) => params.uid
})

export const getStaticPaths = useGetStaticPaths({
client: Client(),
type: 'article',
fallback: true,// process.env.NODE_ENV === 'development',
formatPath: ({ uid }) => ({ params: { uid } })
})

export default Article`

Hi Connor,

Welcome to the Prismic community.

In order to be able to help you in this, can you tell us if you are getting the Slice zone when you use the rest API, if you don't get any data from the rest API then one reason can be that you didn't publish the document.

And if that doesn't solve this issue then it would be great if you can share the name of your repository (in a private message if necessary) so we further investigate this issue.

Looking forward to your reply,
Fares

1 Like

This issue has been closed due to inactivity. Flag to reopen.