Skip to content

Allow interfaces to implement other interfaces #728

@Kingdutch

Description

@Kingdutch

v15 of graphql-js implemented an addition to the GraphQL spec which allows interfaces to implement other interfaces. It would be nice to be able to do this in PHP as well. For example when there is a generic Node interface and a specialised Media Node type needs to be created for images, videos, etc.

graphql-js implementation: graphql/graphql-js#2084
spec addition: graphql/graphql-spec#373

Article on why this is useful: https://dev.to/mikemarcacci/intermediate-interfaces-generic-utility-types-in-graphql-50e8

The following GraphQL schema snippet currently doesn't parse but would be expected to parse after implementation.

interface Node {
  uuid: ID!
}

interface Media implements Node {
  uuid: ID!
  url: String!
}

type Image implements Media & Node {
  uuid: ID!
  url: String!
}

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