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
Is it possible with Nexus to use an inputObjectType as a type for an argument? I see it works well for scalars and enums but fails for an inputObjectType:
exportconstUser=objectType({name: 'User',description: 'Represents a User.',definition(t){t.implements(Node)t.field('inbox',{type: MessageConnection,description: 'A list of messages in the inbox.',args: {first: intArg({description: 'Returns the first n elements from the list.',}),last: intArg({description: 'Returns the last n elements from the list.',}),orderBy: arg({// Type 'NexusInputObjectTypeDef<"MessageOrder">' is not assignable to type 'NexusArgConfigType<"OrderDirection" | "Boolean" | "Float" | "ID" | "Int" | "String">'.type: MessageOrder,description:
'Ordering options for messages returned from the connection.',}),},})},})exportconstMessageOrder=inputObjectType({name: 'MessageOrder',description: 'Ordering options for message connections.',definition(t){t.field('direction',{type: OrderDirection,required: true,description: 'The ordering direction.',})t.field('field',{type: MessageOrderField,required: true,description: 'The field to order messages by.',})},})exportconstMessageOrderField=enumType({name: 'MessageOrderField',description: 'Properties by which message connections can be ordered.',members: [{description: 'Order messages by creation time.',name: 'CREATED_AT',value: 'CREATED_AT',},],})
The text was updated successfully, but these errors were encountered:
Is it possible with Nexus to use an
inputObjectType
as a type for an argument? I see it works well for scalars and enums but fails for aninputObjectType
:The text was updated successfully, but these errors were encountered: