Type-graphql: Integration with Relay? example?

Created on 9 Oct 2018  路  2Comments  路  Source: MichalLytek/type-graphql

I am trying to integrate with graphql-relay and there are few obstacles I am facing.

  1. Ability to set resolveType for an interface.

  2. Ability to pass GraphQLInterfaceType instance as an interface for a type.

  3. Get access to GraphQLObjectType instances generated from classes.

Are these possible?

Question Solved

Most helpful comment

Thanks! I will give it a try.

All 2 comments

Ability to set resolveType for an interface.

By design interfaces doesn't have resolveType implemented because it's done by implementing isTypeOf in ObjectTypes:
https://github.com/19majkel94/type-graphql/blob/master/src/schema/schema-generator.ts#L201-L204
But it's implementable by an @InterfaceType decorator option.

Ability to pass GraphQLInterfaceType instance as an interface for a type.

https://19majkel94.github.io/type-graphql/docs/interfaces-and-inheritance.html#interfaces

Get access to GraphQLObjectType instances generated from classes.

What do you mean? You can do GraphQLSchema.getTypeMap() and you have access to all types.

I think that Relay is a way too much opinionated. I have no experience in using it so it's hard for me to add support for it and as I have no problems with Apollo, I probably won't need to learn Relay 馃槂

Thanks! I will give it a try.

Was this page helpful?
0 / 5 - 0 ratings