I was starting with DatoCMS. I followed the guide to set up the eCommerce Next.js template on Vercel. It all works, but when i changed the DatoCMS schema, I started getting errors for the product page
Application error: a server-side exception has occurred (see the server logs for more information).
Digest: 3450929509
Error: Invalid GraphQL request: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
at l (/var/task/.next/server/chunks/100.js:2:51)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async E (/var/task/.next/server/app/[lng]/products/page.js:1:17288)
Obviously playing with the schema will cause certain things to change, but the error message gives me no clues. I am unfamiliar with graphQL. Just looking to customize the template.
If anyone can help me with better understanding the error or better understanding on how to customize the template. That would be appreciated
Welcome to Dato, and sorry you ran into this issue!
Can you provide any more details about what exactly you changed, both in the Dato project and in your codebase? If you can share the project URL with me and the code you changed (i.e. read access to the repo, or just copying and pasting the changed files), that would really help.
Generally speaking, inside your Dato project, there is a Playground in the upper right of the screen that lets you play with GraphQL without damaging anything. There is also a visual query builder in the left sidebar that lets you easily construct a query by checking the models and fields you want.
And if you run the example in local dev, does it show you any more detailed errors? Can you log the HTTP requests & responses to see what’s breaking?
I’d be happy to help you troubleshoot this more specifically if you can share with us what you actually changed? We can’t diagnose the issue with just that error message, besides seeing that something in products/page.js isn’t working right – probably as a result of the schema changes, as you said.
Also, this might be a helpful quick start to GraphQL queries: https://graphql.org/learn/queries/ (it’s not a hard language, much simpler than SQL). Happy to discuss/explain any of it too.
Alternatively, if you let me know what you would like to change in the ecommerce template, I can make an example project for you showing some of those changes, just to help you get started?
Let us know what we can do to help Sorry for the confusion! Hopefully the learning curve won’t be too high once we get you on the right path.