Is this not a valid way to set args? ``` args...
# graphql-nexus
a
Is this not a valid way to set args?
Copy code
args: {
        data: {
          text: stringArg({ required: true }),
        },
      },
I'm pretty new to TS so these types of errors confuse me.
Copy code
Type '{ text: NexusArgDef<"String">; }' is not assignable to type '"Boolean" | "DateTime" | "Float" | "ID" | "Int" | "String" | NexusArgDef<NexusGenScalarNames> | NexusInputObjectTypeDef<string> | NexusEnumTypeDef<...> | NexusScalarTypeDef<...>'.
  Object literal may only specify known properties, and 'text' does not exist in type 'NexusArgDef<NexusGenScalarNames> | NexusInputObjectTypeDef<string> | NexusEnumTypeDef<string> | NexusScalarTypeDef<...>'.
r
Try to remove the data
Copy code
args: {
    text: stringArg({ required: true }),
 },
a
I added the
data
to emulate the same structure you get from the
t.crud
operations
It worked when I created an inputObject and did this
Copy code
data: arg({ type: UpdateTaskInputType, required: true }),
r
Hey @Awey đŸ‘‹ Yes that’s the correct way to set arguments as nested objects directly cannot be passed.