prisma-labs / graphqlgen

⚙️ Generate type-safe resolvers based upon your GraphQL Schema
MIT License
818 stars 54 forks source link

generate interfaces for graphql interfaces #412

Closed koenpunt closed 5 years ago

koenpunt commented 5 years ago

As implemented before in #149, this generates a typescript interface for every graphql interface.

I also made sure the generated field type unions have distinct types.

koenpunt commented 5 years ago

It might actually be possible to generate the InterfaceType as type InterfaceType = ImplementingTypeA | ImplementingTypeB, since the union should give the same result.

koenpunt commented 5 years ago

It might actually be possible to generate the InterfaceType as type InterfaceType = ImplementingTypeA | ImplementingTypeB, since the union should give the same result.

Unfortunately this doesn't have the same effect as explicitly rendering the fields. Will update this PR later on.

jasonkuhrt commented 5 years ago

I'm wondering why you removed the InterfaceTypes

It wasn't intentional

because that's something that is actually really useful

Could you share your motivating use-case?