You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into an odd situation when using mutationWithClientMutationId. Anytime I attempt to run a mutation that triggers mutateAndGetPayload I'm getting the following response:
The mutation logic always runs successfully, but the responses to mutation queries are always this obscure error. I'm also finding that outputFields' resolve functions never run, even when specifically queried for.
Below is an example of one of the problematic mutations.
const addUser = mutationWithClientMutationId({
name: 'addUser',
inputFields: {
name: {
type: new GraphQLNonNull(GraphQLString),
description: "A user's name",
},
email: {
type: new GraphQLNonNull(GraphQLString),
description: "A user's login email address"
},
password: {
type: new GraphQLNonNull(GraphQLString),
description: "A user's plain text password"
}
},
outputFields: {
user: {
type: UserType,
resolve: payload => {
console.log('USER PAYLOAD', payload);
return payload.user;
}
}
},
mutateAndGetPayload: async ({ name, email, password }) => {
const { valid, message } = User.validatePassword(password);
if (!valid) {
throw new Error(message);
}
try {
const user = await User.create({
name,
email,
password,
});
return { user };
} catch (error) {
throw new Error(error);
}
}
});
I'm really curious if anyone has ran into this before because I cannot find anything out there on the web that resembles this issue. Any thoughts or guidance would be greatly appreciated
Alex
The text was updated successfully, but these errors were encountered:
I have this happen too when trying to use grahql v16. Using graphql v15 seems to work. It looks like this library is directly importing the isPromise method from the graphql library, but they must have changed how that method is exported in v16
I've run into an odd situation when using mutationWithClientMutationId. Anytime I attempt to run a mutation that triggers mutateAndGetPayload I'm getting the following response:
The mutation logic always runs successfully, but the responses to mutation queries are always this obscure error. I'm also finding that outputFields' resolve functions never run, even when specifically queried for.
Below is an example of one of the problematic mutations.
I'm really curious if anyone has ran into this before because I cannot find anything out there on the web that resembles this issue. Any thoughts or guidance would be greatly appreciated
The text was updated successfully, but these errors were encountered: