Questions tagged [prismic.io]

A developer-friendly CMS backend

Home page

178 questions
14
votes
1 answer

GraphQL/Gatsby/Prismic - difference between 'edges.node.data' and 'nodes.data' in query

I'm following this tutorial on Medium to get Gatsby working with Prismic. In the GraphiQL explorer, the two queries below both yield the same result and was wondering when I should use one over the other (i.e. edges.node.data vs nodes.data): Query…
epsilon42
  • 1,863
  • 13
  • 26
9
votes
2 answers

Next.js is not building page as SSG when it should

I am trying to understand why Next.js is building some of my pages as SSG and some of them as Static, when they all are using getStaticProps. Let's take my 404 page that uses getStaticProps to fetch data from prismic with graphql. It is being…
Damian Kociszewski
  • 283
  • 1
  • 5
  • 20
7
votes
1 answer

Prismic - How to make API calls without exposing Access Token

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…
Marcus Gallegos
  • 1,532
  • 1
  • 16
  • 31
6
votes
1 answer

How to generate localized dynamic routes with nuxt and nuxt-i18n?

I'm trying to make nuxt generate localized dynamic routes. I used nuxt-i18n to translate each route. Here is my nuxt-i18n configuation: ['nuxt-i18n', { lazy: true, locales: [ { name: 'French', code: 'fr', iso: 'fr-ch', …
6
votes
1 answer

Graphql error on subfields with graphql-yoga

I'm trying to query a graphql API via a proxy of another graphql API and am receiving an error. I'm using graphql yoga for my server and connecting to another graphql API from a CMS. Here is my code: server.js const { GraphQLServer } =…
red house 87
  • 1,837
  • 9
  • 50
  • 99
5
votes
1 answer

Persistent navigation in a NextJs _app

I'm in the middle of building a Next.js app, and I need to make a request for the navigation content to my Prismic API server-side, get the results, and pass them to my Header component so that I can have a persistent navigation menu. I don't want…
Jesse Winton
  • 568
  • 10
  • 33
5
votes
3 answers

GraphQL query works in Gatsby page but not inside class component

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…
Christoph Berger
  • 341
  • 1
  • 4
  • 16
5
votes
0 answers

Prismic and Ruby on rails : undefined method `[]' for nil:NilClass when trying to get data from prismic api

I'm quite new to ruby and prismic. I'm trying to connect on the controller of my ruby on rails project to the prismic api. their tutorial show the following code : api = Prismic.api('https://your-repo-name.prismic.io/api') doc =…
tim
  • 51
  • 5
4
votes
1 answer

How do I call a Prismic API inside next.js getInitialProps?

How to call the Prismic (CMS) API, from a next.js application? In next.js I have had before: import React from 'react' import Link from 'next/link' import 'isomorphic-fetch' export default class Index extends React.Component { static async…
userden
  • 1,615
  • 6
  • 26
  • 50
4
votes
1 answer

How to do mandatory fields in prismic.io CMS?

I'm using Prismic.io as a headless CMS and bringing content into my React front end. How do I set up a content type so that fields are mandatory? Here's what I have so far... { "Main" : { "uid" : { "type" : "UID", "config" : { …
Eric Clack
  • 1,886
  • 1
  • 15
  • 28
3
votes
0 answers

Module parse failed: Unexpected token error with @prismicio/react?

I have a react app created with CRA using prismic.io. It used to work but now I keep getting module not found error which I keep fixing by running npm install @prismicio/react @prismicio/client @prismicio/helpers after which I get the following…
BAP
  • 31
  • 1
3
votes
1 answer

Netlift build: gatsby-source-prismic - Invalid plugin options | Environment variables in Netlify

When I try to deploy my Gatsby Site on Netlify, it stops deploying and throws the error gatsby-source-prismic - invalid plugin options Local it builds perfect and I have no issues, I added a .env file with PRISMIC_REPOSITORY_NAME and…
kindskopf0204
  • 55
  • 1
  • 5
3
votes
1 answer

ENOENT: no such file or directory preview.vue, prismic module and nuxt-i18n

I get an error message when I use @nuxtjs/prismic and nuxt-i18n. Error message : ERROR ENOENT: no such file or directory, open 'C:\wamp64\www\nuxt-test\prismic\.nuxt\prismic\pages\preview.vue package.json : { "name": "prismic-nuxtjs", …
alex sas
  • 31
  • 1
  • 2
3
votes
3 answers

NuxtJS routing error: Page not found when navigating to an existing route

Just started using Nuxt, and I love it so far. I just have one specific issue, I'm using prismic.io as headless CMS for my personal page. I have a few pages and a "blog" page. I'm having an issue when navigating to the blog route, it returns page…
anieves
  • 51
  • 1
  • 1
  • 5
2
votes
1 answer

next.js - How to specify a port to run start slicemachine app on

I am new to prismic, I just started learning about it last week and how to use it with Next.js projects. I decided to clone the Blog start project of prismic. So I found myself in a situation where I want to have 2 slice machines working…
IsraelBeni
  • 21
  • 3
1
2 3
11 12