0

Background

I created a new Section in Craft CMS called forVenues, and am able to query for data in the CraftQL test endpoint as follows:

{
  entries(section: [forVenues]) {
    ... on ForVenuesChecklist {
      title
      icon {
        url
      }
      description
    }
  }
}

Problem

When I attempt to run the query in a <StaticQuery> component in my React Native Web Gatsby app, I get the following error:

GraphQL Error Expected type Craft_SectionsEnum, found forVenues.

   1 | 
   2 |      {
   3 |          craft {
>  4 |              forVenuesChecklist: entries(section:[forVenues]) {
     |                                                   ^
   5 |                  ... on Craft_ForVenuesChecklist {
   6 |                      title
   7 |                      icon {
   8 |                          url
   9 |                      }
  10 |                      description
  11 |                  }
  12 |              }
  13 |          }
  14 |      }

This indicates that the Gatsby project has not been updated on which Sections are available from the CMS, but I do not know how to resolve this.

Notes

I've already tried clearing the Gatsby cache, restarting the project, restarting the hosted CMS, and changing my query, all to no avail. Any help is appreciated, thanks.

Anthony Krivonos
  • 4,596
  • 4
  • 16
  • 31

1 Answers1

0

Go to Settings > CraftQL, click Settings next to your API Token, and scroll down to Queries and click the field that was just created to open the token scope to expose that value.

Anthony Krivonos
  • 4,596
  • 4
  • 16
  • 31