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

Add support for overriding types for specific fields #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

riffbyte
Copy link

@riffbyte riffbyte commented Apr 20, 2021

This change was introduced in our fork to have stronger types for JSON fields - since Contentful can't know what structure each JSON field has, the codegen rightfully states that its type is Record<string, any>, which is not ideal when these fields are extensively used.

The changes in this PR allow for configurable overrides of such types (any types for that matter) via getFieldOverrides.js file, which exports the config for overriden types, as well as any extra imports required to make the types work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant