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