LekoArts / gatsby-starter-portfolio-bella

A bright single-page portfolio starter for Gatsby powered by Prismic.io. The target audience are designers and photographers.
https://portfolio-bella.netlify.com/
MIT License
124 stars 18 forks source link

Set up instructions are not working for me #4

Closed matine closed 6 years ago

matine commented 6 years ago

Hello,

Thanks for this great starter portfolio! It looks really great apart from the fact I'm having some trouble setting it up using your instructions.

I've followed your guide and have set up a prismic repo, added content, the API key etc. It does compile so that says to me that it is accessing the prismic repo. But it doesn't seem to retrieve the data in the index page.

I get lots of errors in the console but the first important one being...

The prop `data` is marked as required in `IndexPage`, but its value is `undefined`

And in the command line when compiling I get...

ℹ 「wdm」:
ℹ 「wdm」: Compiled successfully.
 WAIT  Compiling...                                                                                                                                                                                                                                                   3:13:51 PM

ℹ 「wdm」: Compiling...
GraphQL Error Unknown field `prismicCaseStudy` on type `Query`

  file: /Users/matinechabrier/Sites/gatsby-starter-portfolio-bella/src/templates/case.jsx

   1 |
   2 |   query CaseBySlug($uid: String!) {
>  3 |     prismicCaseStudy(uid: { eq: $uid }) {
     |     ^
   4 |       uid
   5 |       first_publication_date
   6 |       last_publication_date
   7 |       data {
   8 |         header_image {
   9 |           localFile {
  10 |             childImageSharp {
  11 |               sizes(maxWidth: 1920, quality: 90, traceSVG: { color: "#021212" }) {
  12 |                 ...GatsbyImageSharpSizes_withWebp_tracedSVG
  13 |               }

I'm wondering do I need more in my env file? I only have that API key in there. Otherwise I'm really not sure what it could be as it looks correct to me.

LekoArts commented 6 years ago

Did you set up the custom type with the JSON I provide and created at least one document with this custom type? The PropTypes warning says that it didn't get any data back from the query.

matine commented 6 years ago

Yeh I created a new repo, added 'Case study' as a custom type and added content for one case study.

screen shot 2018-11-01 at 16 03 49

LekoArts commented 6 years ago

Please try another image as sharp can't process .gif files. I think we can narrow it down to Prismic as I just successfully used this starter locally with my Prismic repository.

Does the query for in GraphiQL? (So localhost:8000/___graphql)

matine commented 6 years ago

Yes that worked!! It was because it was a gif.

Thanks so much :)

LekoArts commented 6 years ago

I think I'll add that to the README. Glad that you got it working. Have fun 👍