I'm getting started with Relay and GraphCool and have trouble creating the createUser Mutation with Relay.
This is my current code:
import Relay from 'react-relay';
class SignupUserMutation extends Relay.Mutation {
getMutation() {
return Relay.QL`
mutation {
createUser(input: {
authProvider: {email: { email: $email, password: $password }},
clientMutationId: "createuser1"
}) {
clientMutationId
}
}
`;
}
getVariables() {
return {
email: this.props.email,
password: this.props.password
};
}
getFatQuery() {
return Relay.QL`
fragment on CreateUserPayload {
viewer { id }
}
`;
}
getConfigs() {
return [{
type: 'RANGE_ADD',
parentName: 'viewer',
parentID: this.props.viewerId,
connectionName: 'users',
edgeName: 'usereEdge',
rangeBehaviors: {
'': 'append',
},
}];
}
}
export default SignupUserMutation;
I keep getting the error:
Variable '$input_0' expected value of type 'SignupUserInput!' but got: {"email":"fdadsffd@fasdf.at","password":"@fdsad","clientMutationId":"1"}. Reason: Unknown field 'email' is not defined in the input type 'SignupUserInput'. (line 1, column 29):↵mutation SignupUserMutation($input_0:SignupUserInput!) {
What am I doing wrong here?