Skip to content

Add generic IconInterface #106

@jbach

Description

@jbach

What are you trying to do?

When handling icon-picker fields via fragments in GraphQL, the field handle is currently explicitly used in the GQL type. This prevents a generic, relay-style fragment/component which could be used on any icon-picker field, regardless the field handle.

What's your proposed solution?

All icon-picker GQL types (myIconField_Icon) could implement a generic IconInterface, which would allow generically implementing icon-picker fields with a singular fragment/component:

fragment Icon on IconInterface {
  value
  iconSet
  label
  keywords
  type
  isEmpty
  url
  path
  inline
  glyph
  glyphName
}

fragment Article on Article_Entry {
  articleIcon {
    ...Icon
  }
}

fragment Teaser on Teaser_Entry {
  teaserIcon {
    ...Icon
  }
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions