Steams / ra-data-hasura-graphql

React-admin data provider for Hasura GraphQL endpoints
MIT License
211 stars 33 forks source link

AutocompleteInput error #8

Closed joshhopkins closed 4 years ago

joshhopkins commented 4 years ago

AutocompleteInput broken: GraphQL error: field "q" not found in type: GraphQL_TYPE__bool_exp

cpursley commented 4 years ago

That field type is just an example. Try using the actual field name in the filter definition.

Steams commented 4 years ago

@joshhopkins Perhaps it was an issue on a previous commit but autocompleteInput seems to be working perfectly fine currently. If you update to the latest release of the lib (0.1.7) and are still having the issue, please post a snippet of the code causing the error.

joshhopkins commented 4 years ago

@Steams thanks, just tested with 0.1.7. I should clarify that I'm populating the choices attributed with a list of related records using <ReferenceInput>.

This throws: undefined is not an object (evaluating 'i.type'):

<ReferenceInput source="post_id" reference="posts" validate={required()}>
    <AutocompleteInput optionText="title" optionValue="post_id" />
</ReferenceInput>
joshhopkins commented 4 years ago

Solved. Not a bug, but a less obvious "feature" of react-admin. https://github.com/marmelab/react-admin/issues/2615

ghost commented 2 years ago

I'll leave this here, as a follow-up to the issue.

https://marmelab.com/react-admin/Upgrade.html#referenceinput-no-longer-accepts-the-filtertoquery-prop

cpursley commented 2 years ago

Thanks @zenomeki

Heads up that Hasura has taken over maintenance of this library: https://github.com/hasura/ra-data-hasura