Open 321zeno opened 3 months ago
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
What i also do after upgrade:
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
The error message Type NavPage_Test must define one or more fields.", shows up
- this still happens Also the nav() query is not visible in the Explorer (only ping)
- this is visible in the Explorer and works when querying
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 hidden
field to the blueprint.
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 up Also thenav()
query is not visible in the Explorer (onlyping
)Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response