artsy / metaphysics

Artsy's GraphQL API
MIT License
360 stars 89 forks source link

chore(homeView): switch from union to interface #6007

Closed dblandin closed 1 week ago

dblandin commented 1 week ago

This allows us to query for generally supported attributes across all sections without needed a named fragment like ... on HomeViewSectionGeneric. This does switch the connection from exposing a Union to an Interface, but all else seems to work exactly the same.

I don't see much of a downside here. There was some recent discussion in Slack regarding the matchConnection field using a union type instead of an interface implemented for searchConnection but I think the real problems with the searchConnection field stems more from the query introspection and this error rather than the implementation of an interface-backed connection.

Example

{
  homeView {
    sectionsConnection(first: 5) {
      __typename
      internalID
      component {
        title
      }
      contextModule
    }
  }
}
anandaroop commented 1 week ago

this is a no-op over in Eigen

Yep, all good in TestFlight too