Property 'prismic' of undefined

Thanks for the advice, added preview on the plugin options but still no luck. same error

Cannot read property 'prismic' of undefined

Here's my plugin setting

{
      resolve: 'gatsby-source-prismic-graphql',
      options: {
        repositoryName: process.env.REPO_NAME,
        accessToken: process.env.ACCESS_TOKEN,
        path: '/preview',
        previews: true,
        linkResolver: () => post => `/${post.uid}`,
      }
},