question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error GraphQL Error Unknown type "PrismicPostBodyText".

See original GitHub issue

Hey, fantastic starter, really eager to get rolling with it. I have tried all I can think of to resolve this issue and followed every step. Maybe I am simply missing something. I am a bit of a noob with graphQL and Gatsby, prismic is a first for me too.

I have used the README and followed it very carefully step by step. I have read the previous issue with a similar error https://github.com/LekoArts/gatsby-starter-prismic/issues/5

I cannot stop this error from happening

> gatsby-starter-prismicio@1.0.0 develop /Users/davidjamesmitten/Dev/sites/dave-blog-site
> gatsby develop

success open and validate gatsby-configs — 0.144 s
success load plugins — 0.241 s
success onPreInit — 0.866 s
success delete html and css files from previous builds — 0.011 s
success initialize cache — 0.004 s
success copy gatsby files — 0.093 s
success onPreBootstrap — 0.008 s
⠁ Starting to fetch data from Prismic
error Plugin gatsby-source-prismic returned an error


  Error: Unexpected status code [401] on URL https://gatsby-starter-prismic.prismic.io/api/v2?access_token=MC5YRUxZaVJBQUFDRUFHUExG.77-9TGcxej_vv71mW--_vRxu77-9W--_vWvvv71WJHAiTO  -_ve-_ve-_vR10Ie-_vXBWbQ
  
  - prismic-javascript.min.js:1 
    [dave-blog-site]/[prismic-javascript]/dist/prismic-javascript.min.js:1:14909
  
  - util.js:16 tryCatcher
    [dave-blog-site]/[bluebird]/js/release/util.js:16:23
  
  - promise.js:512 Promise._settlePromiseFromHandler
    [dave-blog-site]/[bluebird]/js/release/promise.js:512:31
  
  - promise.js:569 Promise._settlePromise
    [dave-blog-site]/[bluebird]/js/release/promise.js:569:18
  
  - promise.js:614 Promise._settlePromise0
    [dave-blog-site]/[bluebird]/js/release/promise.js:614:10
  
  - promise.js:694 Promise._settlePromises
    [dave-blog-site]/[bluebird]/js/release/promise.js:694:18
  
  - async.js:138 _drainQueueStep
    [dave-blog-site]/[bluebird]/js/release/async.js:138:12
  
  - async.js:131 _drainQueue
    [dave-blog-site]/[bluebird]/js/release/async.js:131:9
  
  - async.js:147 Async._drainQueues
    [dave-blog-site]/[bluebird]/js/release/async.js:147:5
  
  - async.js:17 Immediate.Async.drainQueues
    [dave-blog-site]/[bluebird]/js/release/async.js:17:14
  

warning The gatsby-source-prismic plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes — 0.541 s
success building schema — 0.201 s
error gatsby-node.js returned an error


  TypeError: Cannot read property 'allPrismicPost' of undefined
  
  - gatsby-node.js:41 Object.exports.createPages
    /Users/davidjamesmitten/Dev/sites/dave-blog-site/gatsby-node.js:41:35
  
  

success createPages — 0.018 s
success createPagesStatefully — 0.051 s
success onPreExtractQueries — 0.001 s
success update schema — 0.091 s
error GraphQL Error Unknown type "PrismicPostBodyText".

  file: /Users/davidjamesmitten/Dev/sites/dave-blog-site/src/templates/post.jsx

  13 |         categories {
  14 |           category {
  15 |             document {
  16 |               data {
  17 |                 name
  18 |               }
  19 |             }
  20 |           }
  21 |         }
  22 |         body {
> 23 |           ... on PrismicPostBodyText {
     |                  ^
  24 |             slice_type
  25 |             id
  26 |             primary {
  27 |               text {
  28 |                 html
  29 |               }
  30 |             }
  31 |           }
  32 |           ... on PrismicPostBodyCodeBlock {
  33 |             slice_type

success extract queries from components — 0.199 s
⠁ (node:24681) DeprecationWarning: Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.
success run graphql queries — 0.012 s — 2/2 226.25 queries/second
success write out page data — 0.010 s
success write out redirect data — 0.001 s
⠄ onPostBootstrapdone generating icons for manifest
success onPostBootstrap — 0.244 s

info bootstrap finished - 6.066 s

 DONE  Compiled successfully in 2217ms                                                                                                                                    08:33:30


You can now view gatsby-starter-prismicio in the browser.

  http://localhost:8000/

View GraphiQL, an in-browser IDE, to explore your site's data and schema

  http://localhost:8000/___graphql

Note that the development build is not optimized.
To create a production build, use gatsby build

ℹ 「wdm」: 
ℹ 「wdm」: Compiled successfully.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
YaroslawBagriycommented, Apr 3, 2019

Another problem which could help some people is that in the gatsby-config.js file, it is necessary to remove the lang: ‘en-gb’ if English is your only language. I spent a few hours getting this to build because of the language problem. Thank you again LekoArts, this is an amazing blog!

1reaction
balakedevcommented, Oct 24, 2019

@LekoArts

How do we make it so that the slices are not mandatory? So that clients can plug and play what they like?

Read more comments on GitHub >

github_iconTop Results From Across the Web

graphql:1:error:Unknown type \"Int\"."
Hello, I tried to Apollo 1.0.1 for my project trying with the both options spm and manual. I encounter the same problem.
Read more >
[GraphQL error]: Message: Unknown type "postsConnection ...
Based on the error you're seeing, postsConnection is not a valid type. Check the documentation for your schema or run an introspection query ......
Read more >
Schemas and Types - GraphQL
On this page, you'll learn all you need to know about the GraphQL type system and how it describes what data can be...
Read more >
Unknown type "PRISMIC_SortPagey" - Developing with Prismic
We're using the gatsby-source-prismic-graphql plugin. ... My build fails with error: GraphQLError: Unknown type "PRISMIC_SortBlog_posty" ...
Read more >
ESLint Foss Error (#365500) · Issues - GitLab.org
mutation.graphql 9:20 error Unknown type "JsonString". Did you mean "String"? @graphql-eslint/known-type-names ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found