Gatsby + DatoCMS, how do I add a new page?

I’m stuck (first time trying to use GatsbyJS + DatoCMS + Netlify). I added a new page in DatoCMS and I also added it to my repo here

However, I can’t get the build to work since I get this error: ā€œThere was an error in your GraphQL query: Cannot query field ā€œdatoCmsCvPageā€ on type ā€œQueryā€.ā€ - I understand why I’m getting the error, however, I don’t know how to add this to my GraphQL query anywhere. Could anyone just explain to me how I would get this working and added?

Hello @johansson-tobias and welcome! :slight_smile:

The field that you should query depends on the name of your DatoCMS model. So if you model’s API key is cv you should query datoCmsCv. If instead your model’s API key is cv_page you should query for datoCmsCvPage.

Hope this helps!

1 Like

Ah! Now I get how that works. :smiley: Sorry! I totally missed that, but makes a lot of sense and that instantly fixed my issue. :slight_smile:

Thanks for the help!

1 Like