You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose an upgrade to the typing system.
Currently when creating plugins you have to limit the generics to extends string if you want to be able to access values using RootValue for example. It would be great to be able to use NexusObjectTypeDef instead. Here is an example from the plugin I am currently working on:
constmyRule=ruleType({type: Test,// Not possible since NexusObjectTypeDef<'Test'> is no assignable to 'Test'resolve: (_root,_args,_ctx,_info)=>{returntrue;},});exportconstTest=objectType({name: 'Test',definition(t){t.id('id');t.string('prop');t.field('test',{type: EnumTest,shield: myRule,resolve(_root){return'test';},});},});
The text was updated successfully, but these errors were encountered:
I would like to propose an upgrade to the typing system.
Currently when creating plugins you have to limit the generics to
extends string
if you want to be able to access values usingRootValue
for example. It would be great to be able to useNexusObjectTypeDef
instead. Here is an example from the plugin I am currently working on:The text was updated successfully, but these errors were encountered: