-
-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type NavPage_* must define one or more fields error in GraphiQL #10621
Comments
I'm not sure why it wasn't working, but it's working now, possibly the cache took a while to update, closing. |
@duncanmcclean Hi, i have same error. Upgraded from version 4 to version 5. Statamic Version: 5.24.0 {
"message": "Type NavPage_Footer must define one or more fields.",
"extensions": {},
"stack": "GraphQLError: Type NavPage_Footer must define one or more fields.\n at SchemaValidationContext.reportError (https://unpkg.com/graphiql/graphiql.min.js:34515:23)\n at validateFields (https://unpkg.com/graphiql/graphiql.min.js:34632:13)\n at validateTypes (https://unpkg.com/graphiql/graphiql.min.js:34611:7)\n at Object.validateSchema (https://unpkg.com/graphiql/graphiql.min.js:34491:3)\n at https://unpkg.com/graphiql/graphiql.min.js:71072:20\n at updateMemo (https://unpkg.com/react-dom@18/umd/react-dom.development.js:16437:21)\n at Object.useMemo (https://unpkg.com/react-dom@18/umd/react-dom.development.js:17077:18)\n at Object.useMemo (https://unpkg.com/react@18/umd/react.development.js:1640:23)\n at SchemaContextProvider (https://unpkg.com/graphiql/graphiql.min.js:71068:34)\n at renderWithHooks (https://unpkg.com/react-dom@18/umd/react-dom.development.js:15496:20)"
}, That's how my footer blueprint looks
There were no problems in version 4 |
Yeah, I can confirm that the error still pops up for me, with a small correction from my original ticket
|
I believe this happens when you have a nav and haven't added any fields to the blueprint. You shouldn't need to, but if you want to work around it until a fix is ready, you can just add a |
Bug description
I created a new Statamic project, enabled pro and GraphQL locally and created a super user for the CP.
I created a new Navigation called "Test"
When I open GraphiQL if fails to fetch the schema with the message
How to reproduce
composer create-project --prefer-dist statamic/statamic statamic-nav
php please make:user
resources.navs
instatamic-nav/config/statamic/graphql.php
php artisan serve
The error message
Type NavPage_Test must define one or more fields.",
shows upAlso the
nav()
query is not visible in the Explorer (onlyping
)Logs
Nothing in the logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: