Is it possible to implement multiple interfaces in GraphQL?

Viewed 13971

Is it possible to specify a type that implements multiple interfaces within a GraphQL schema? If so, how would this be accomplished?

3 Answers

I think yes, it should be possible as the specification describes on http://facebook.github.io/graphql/June2018/#sec-Interfaces.

Here is the example.

interface NamedEntity {
  name: String
}

interface ValuedEntity {
  value: Int
}

type Person implements NamedEntity {
  name: String
  age: Int
}

type Business implements NamedEntity & ValuedEntity {
  name: String
  value: Int
  employeeCount: Int
}
Related