JSON Field return type

default discord avatar
3 months ago

Generated types gives the following as the type for JSON fields.

| {
        [k: string]: unknown;
    | unknown[]
    | string
    | number
    | boolean
    | null;

How do I tell it to use my interface or type?

Help 🥺

@jarrod69420 @jacobsfletch Sorry for tagging. Any suggestions?

  • discord user avatar
    Payload Team
    3 months ago

    right now it is not possible to "override" a specific field's generated type, but it would be pretty easy to build a new feature to do so

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.