Skip to main content
Answer

interfaces vs. types

  • March 20, 2023
  • 1 reply
  • 59 views

Juan Alvarado
Seasoned
Forum|alt.badge.img

More of a design question: only interfaces are allowed after the implements keyword, so you have to know what types you plan to extend beforehand, but this is not always possible or reliable. Since interfaces also produce views, I am tempted to make everything an interface, but are there any downsides?

Best answer by Anders Hafreager

Yeah, this is following the GraphQL spec. You can actually use interface everywhere and that should work fine! 

1 reply

Anders Hafreager
Practitioner

Yeah, this is following the GraphQL spec. You can actually use interface everywhere and that should work fine!