Skip to content

MediaItem should be an Interface and each Mime Type should be a GraphQL Type #764

@jasonbahl

Description

@jasonbahl

Currently, we expose a MediaItem type, and it's shape is very much based on Media Items being images.

Media Items can be images, videos, PDFs, .txt, and heaps of other things.

I think we may want to revisit using Interfaces / Unions to better specify the Type of Media a MediaItem is.

Not 100% sure what this should look like, but I believe it's something we should think about.

Possibly something like this (needs a lot more thought though):

{
  mediaItem {
     id
     title
     ...on Image {
        someImageProperty
     }
     ...on Video {
        duration
        someOtherVideoProperty
     }
     ...on PDF {
       somePdfProperty
     }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    💬 In Discussion

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions