23 Replies
If useForm's queryResult is returning results then the problem cannot be here
absent-sapphire•2y ago
Correct
Can you check your network requests? There we can find the wrong request
absent-sapphire•2y ago
This is the query that is being sent out:
query ($id: ID!) { user (id: $id) }
And this is the message in the response: Field "user" of type "UserWithRoles" must have a selection of subfields. Did you mean "user { ... }"?
Does the error go away when you remove the useForm?
absent-sapphire•2y ago
Haven't tried that
Give me minute
Yes, its still there
Let's try to remove useList as well
absent-sapphire•2y ago
Just caught it
It's coming from
const { register, handleSubmit } = useReactHookForm({ }
Import statement of the same: import { useForm as useReactHookForm } from '@pankod/refine-react-hook-form'
hmm why did you import two forms?
absent-sapphire•2y ago
Both are two different things right?
@pankod/refine-react-hook-form package extends useForm already in core. So just use @pankod/refine-react-hook-form
absent-sapphire•2y ago
Ohh
absent-sapphire•2y ago
Will this be a good example for me to follow?
https://github.com/pankod/refine/blob/master/examples/form/mui/useForm/src/pages/posts/edit.tsx
Yes definitely, you can have a look here to use the properties in core
https://refine.dev/docs/packages/documentation/react-hook-form/useForm/#properties