AutoForm BelongsTo fields not working
Typescript project.
I'm using an AutoForm to create an inventory item, with the model schema depicted. All the Autoform Fields work, except for those that are relational.
I get this error:
[GraphQL] Variable "$item" got invalid value "11" at "item.sublocation"; Expected type "InternalBelongsToInput" to be an object. [GraphQL] Variable "$item" got invalid value "12" at "item.location"; Expected type "InternalBelongsToInput" to be an object. [GraphQL] Variable "$item" got invalid value "1" at "item.user"; Expected type "InternalBelongsToInput" to be an object.
Is it the case that AutoForm does not currently support these fields, as the api is requiring an object?

1 Reply
Hi Shunt,
I am not sure how you wrote your component, but I have an example here on assigning relationships with AutoForms,
And more information on this example here: https://docs.gadget.dev/reference/react/auto#custom-selection-and-conditionally-rendered-inputs
I would be happy to take a look, let us know if this helps!