prismic.io

GraphQL query works in Gatsby page but not inside class component

血红的双手。 提交于 2020-06-09 02:03:42
问题 There have been a couple of similar questions, but none helped me really understand using a GraphQL inside a (class) component other than the ones in the pages folder. My project structure looks like that: -src --components ---aboutBody ----index.js --pages ---about.js I have a page component called about (Prismic single page type) and set up some components to "fill" this page (cleaned up for better readability). class AboutPage extends Component { render() { return ( <LayoutDefault>

GraphQL query works in Gatsby page but not inside class component

旧城冷巷雨未停 提交于 2020-06-09 02:02:11
问题 There have been a couple of similar questions, but none helped me really understand using a GraphQL inside a (class) component other than the ones in the pages folder. My project structure looks like that: -src --components ---aboutBody ----index.js --pages ---about.js I have a page component called about (Prismic single page type) and set up some components to "fill" this page (cleaned up for better readability). class AboutPage extends Component { render() { return ( <LayoutDefault>

GraphQL query works in Gatsby page but not inside class component

亡梦爱人 提交于 2020-06-09 02:02:03
问题 There have been a couple of similar questions, but none helped me really understand using a GraphQL inside a (class) component other than the ones in the pages folder. My project structure looks like that: -src --components ---aboutBody ----index.js --pages ---about.js I have a page component called about (Prismic single page type) and set up some components to "fill" this page (cleaned up for better readability). class AboutPage extends Component { render() { return ( <LayoutDefault>

Prismic - How to make API calls without exposing Access Token

大城市里の小女人 提交于 2020-05-29 03:50:08
问题 I'm building a vue js web app and I would like to make respective calls to the to my prismic repo, but I don't know how to do it without exposing my access token. I am using the rest api approach shown here. Any ideas? The http request syntax is as follows. I want to do this inside my vue components while not exposing the access_token. http://your-repository-name.prismic.io/api/v2/documents/search?ref=Your_Ref&access_token=Your_Token In my API/Security settings I'm also given a Client ID and