CMeeg / gridsome-source-kentico-kontent

Kentico Kontent data source plugin for Gridsome.
MIT License
6 stars 4 forks source link

Preview mode using plugin? #16

Open johncherba opened 4 years ago

johncherba commented 4 years ago

Hello,

I am trying to get Preview Mode to work pulling in Draft content from Kentico Kontent.

Here's what I have in the gridsome.config.js file:

plugins: [
        {
            use: '@meeg/gridsome-source-kentico-kontent',
            options: {
                deliveryClientConfig: {
                    projectId: process.env.KENTICO_KONTENT_PROJECT_ID,
                    previewApiKey: process.env.KENTICO_KONTENT_PREVIEW_API_KEY,
                    globalQueryConfig: {
                        usePreviewMode: true,
                        useSecuredMode: false,
                    },
                    contentItemsDepth: 6,
                }
            }
        }

If I use usePreviewMode: true I get the following error:

TypeError: schemaComposer.get(...).hasInterface is not a function

If I flip it to usePreviewMode: false it runs in develop mode just fine, but does not pull in the preview api call. I was able to get preview text by using other api calls, etc. I tried this in two different projects and can not get it to work.

Does it work? If so, what am I not doing in the config to set it properly?

Thank you for your help!