I'm using graphql apollo client for Android. I'm able to pass data using mutation for a single fields without any issue. While using input object in mutation the error cannot read property of email undefined occurred. But same graphql working while running in the browser.
Graphql mutation
mutation signup($SignupInput:SignupInput) {
signup(data: $SignupInput) {
result{token,firstName,lastName,profileImage}
}
}
Input
{"SignupInput": {"firstName": "John","lastName": "Peter","email": "[email protected]"
,"password": "123123"}}
Java Code for API call
final SignupInput signupInput=SignupInput.builder()
.firstName(edtSignUpName.getText().toString())
.lastName(edtSignUpLastName.getText().toString())
.email(actvSignUpEmail.getText().toString())
.password(edtSignUpPassword.getText().toString())
.profileImage("dasfasdfasdf.png").build();
final SignupMutation signupMutation = SignupMutation.builder()
.signupInput(signupInput)
.build();
signupCall = appController.apolloClient()
.mutate(signupMutation);
signupCall.enqueue(dataCallback);