That was unexpected - declared tone of configs, wrote tone of graphql queries in nextjs pages using generated types and decided its time for cleanup ui in CMS - and boom - everything broken as i changed labels 🤪
I even checked - you have Settings in group One and Settings in group Two - it will make Settings and Settings1 instead of used slugs.
These changes were released in v1.2.
This is about to improve actually - very shortly. At first we did this because labels generally aligned more closely to naming conventions of GraphQL types but I agree, it’s not expected. Keep an eye out for more here shortly
You're absolutely right @itspers,
I've made this change and included it in the PR for i18n. #1326
This is a breaking change and will be documented in the release notes, but know that if you were relying on the labels for globals and collections for the GraphQL schema names, you will have to make a small change to your config or the client code calling GraphQL.
Going forward, slugs will be responsible for graphQL schema names by default. If you wish to override the names Payload derives from the slug, you can be explicit using the new properties on Collections and Globals to do so.
Collections new object for GraphQL is:
graphQL?: {
singularName?: string
pluralName?: string
}
and globals has a new property for graphQLName?: string
.
The change is still open for review if you have any comments.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.