What you were expecting:
The AutocompleteInput component should send a request for searching the field defined as OptionName to the data provider.
What happened instead:
The AutocompleteInput component sends a request to search in field "q" to the data provider:
http://localhost:3000/code_country?order=id.desc&q=ilike.%2A%2A
which generates the error "column code_country.q does not exist".
Steps to reproduce:
Example:
<ReferenceInput label="resources.address.fields.country" source="country_id" reference="code_country">
<AutocompleteInput optionText="name" optionValue="id" />
</ReferenceInput>
Environment
You need to pass filterToQuery function prop into ReferenceInput
In your case filterToQuery={searchText => ({ name: searchText })}>
yep, as @kctrlv said, it's not a bug, it's a feature!
Thanks for this, it helped. But wouldn't it be better to disable this behaviour per default as it needs a special implementation of the data provider? Anyway, I'm happy now.
I think this "feature" is kind of a hidden feature, I had to dig through the issues to find it :sweat_smile:
Most helpful comment
You need to pass
filterToQueryfunction prop intoReferenceInputIn your case
filterToQuery={searchText => ({ name: searchText })}>