InputTypes generated for Discriminators
May have missed the options.... But, for example, in using the CreateOne*Input type for the createOne resolver, the discriminatorKey field isnt included in the generated type.
So for the documentation example-
CharacterSchema.set('discriminatorKey', 'type');
The type field is not included in the CreateOneDroidInput
Is it possible to include it for the inputType?
You may add it manually:
CreateOneResolver.getArgITC('record').setField('type', 'String!');
graphql-compose allows modifying all generated types as you wish. Anyway, feel free to write your custom resolver if you met with a complex situation uncovered by a generator (composeMongoose()).
Thanks. Will do.
BTW- What was the thinking for not including? Just wondering if Im my implementation is crazy
Yep, it can be added but need to think about how it can be implemented. CharacterSchema.set('discriminatorKey', 'type'); added to mongoose schema without any hint about what exactly type is used for this field (string, int, float).
It will be nice if you have time to open Pull Request and propose your solution.