Skip to content

Commit

Permalink
Add logging messages on some server side endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
gvc committed Sep 20, 2023
1 parent d0ae11c commit 63744d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const handler = async (
return
}

console.log('calling the api')

const { operationName, variables, query } = parseRequest(req)

try {
Expand All @@ -50,6 +52,8 @@ const handler = async (
if (hasErrors) {
const error = errors.find(isFastStoreError)

console.error(error)

res.status(error?.extensions.status ?? 500)
}

Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export async function getServerData() {

const cmsHome = await getCMSPageDataByContentType('home')

console.log("Calling server data on homepage");

return {
status: 200,
props: { cmsHome },
Expand Down

0 comments on commit 63744d7

Please sign in to comment.