Can an interface implement another interface?

I’ve had a look around and cant find much information on this.

Can an interface implement another interface?

My example data model is that there are ‘payees’, and these payees can considered ‘billers’ or ‘transfers’, and within transfers, there are ‘payid’ and ‘account’.

So was thinking I’d have
interface payee
interface transfer implements payee
type payid implements transfer
type account implements transfer

Something like that, and then in the queries from client, have fragments (inline or named)

Is it recommended? or when would/wouldnt it be recommended?

Currently designing schema for Apollo Server, potentially with a view to move onto Federation later on. Would queries with nested inline fragments still work with federation?

Yes latest GraphQL spec supports interface implementing other interfaces. See GraphQL spec

Would queries with nested inline fragments still work with federation?

At the end of the day federated Supergraph API schema is still a valid GraphQL schema, so yes you can write queries with fragments.

1 Like