Skip to content
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

fix(contentful): Add restricted content model names #30234

Closed

Conversation

AbsoluteSuccess
Copy link

Description

This PR adds 2 restricted model names to restrictedNodeFields array so that when one uses those 2 model names, the error notifies the developer about it. Those 2 model names are Reference and Entity. The related issue explains why those 2 names cannot be used.

Related issues

Fixes #30089

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 13, 2021
@LekoArts LekoArts changed the title Add restricted content model names fix(contentful): Add restricted content model names Mar 15, 2021
@LekoArts LekoArts added topic: source-contentful Related to Gatsby's integration with Contentful and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 15, 2021
@axe312ger
Copy link
Collaborator

axe312ger commented Mar 16, 2021

Thank you!!

But I think this won't work. Did you try it out?

@axe312ger axe312ger added the status: needs core review Currently awaiting review from Core team member label Mar 16, 2021
@@ -22,6 +22,8 @@ const restrictedNodeFields = [
`id`,
`internal`,
`parent`,
`Entity`,
`Reference`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This restricts field names, but we need to restrict Content Type names

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was analyzing the code, but I could not figure out how to restrict the Content Type names. Could you give a hint?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either :D

@axe312ger
Copy link
Collaborator

My PR at #30715 should address this now properly :)

@LekoArts
Copy link
Contributor

LekoArts commented Sep 7, 2021

Closing in favor of #30715

@LekoArts LekoArts closed this Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs core review Currently awaiting review from Core team member topic: source-contentful Related to Gatsby's integration with Contentful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gatsby-source-contentful: Warn/error when content model uses Entry or Reference as content type
4 participants