My useLazyQuery isn’t working and mutation also. but when a normal query without parameters is working fine. I get a 400 bad request. please help
//my login query
export const LOGIN = gql`
query login ($email: String, $password: String){
login(email: $email, password: $password){
token
}
}
`
//declaring the useLazyQuery
const [login, {called, loading, error,data}] = useLazyQuery(LOGIN, {variables: {email, password} })
//
onClick={(e)=>{ }
while the below code works well and returns the token on the playground
query login {
login(
email: "demo@demo.com",
password: "1234"
)
{
token
}
}