Git Product home page Git Product logo

Comments (4)

veu avatar veu commented on May 30, 2024 1

@jacksonopp You’re right. Resolved inks in rich text fields are currently not covered by the types in contentful.js. Feel free to file a feature request in contentful.js itself.

from cf-content-types-generator.

veu avatar veu commented on May 30, 2024 1

Closing this issue in favor of contentful/contentful.js#1921

from cf-content-types-generator.

veu avatar veu commented on May 30, 2024

TypeCeTextBlockSkeleton is an abstract description of how the entry looks like using the EntryFieldTypes. It can be used in two ways:

  • Pass it to the CDA methods to get the correct return type which matches your fetched entry data.
  • Pass it to the Entry type together with the client configuration you’re using if you want to use the types in other parts of your code. The resulting type again matches your entry data. The generator creates the TypeCeTextBlock to make this a bit more convenient.

from cf-content-types-generator.

jacksonopp avatar jacksonopp commented on May 30, 2024

I'm running up against a similar issue when it comes to resolved links within embedded entries inside rich text fields. Not sure if this is an issue with this library or with the ngx-contentful-rich-text library I'm using.

In this example, I'm creating a hero component based off of a hero content type.

The data that I have access to inside the component I'm rendering for the embedded asset matches the TypeHeroFields. I access this by essentially casting that data into the TypeHeroFields type. One of the fields in TypeHeroFields is a image content type, which is a wrapper content type around an asset (we're just adding some SEO fields to an asset basically). Since we're resolving that data in the CDA method, the type mismatches, since it's no longer a link, but the actual data.

I'm able to work around this by doing data.heroImage as unknown as Entry<TypeImageSkeleton>, but this doesn't seem to be the right pattern.

Sorry if this description is a little confusing. I can elaborate if you need me to.

from cf-content-types-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.