From the course: Build a Lightweight Full-Stack Headless CMS Using Next.js, Contentful, and GraphQL
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Test your API connection - GraphQL Tutorial
From the course: Build a Lightweight Full-Stack Headless CMS Using Next.js, Contentful, and GraphQL
Test your API connection
- [Instructor] Now that you have your project deployed and your local project connected to your Contentful API, let's go ahead and test our API connection, make sure our sample content is coming through to the frontend. So, from here, if you're in Codespaces, make sure you're in the terminal that says Codespace. If you're in your local development environment, you can just run in your terminal, whichever is open. So, let's go ahead and run the command npm run dev, and if everything's working, it should go ahead and give you this local host link. Let's go ahead and do that. Okay, and my content is coming through, and we don't have any errors. Something that is common with a setup like this is, if you don't have an access token or even one character is off, it's going to throw an error. The computer is going to scream at you, which you can see here. Yeah, I can see it in my terminal. I can also see it here. And if you're getting this error, it's just because you may have forgotten your…