@szymonpiatek/nextwordpress 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -312,9 +312,6 @@ var GQL_SEND_PASSWORD_RESET_EMAIL = `
312
312
  mutation SendPasswordResetEmail($input: SendPasswordResetEmailInput!) {
313
313
  sendPasswordResetEmail(input: $input) {
314
314
  success
315
- user {
316
- email
317
- }
318
315
  }
319
316
  }
320
317
  `;
@@ -333,7 +330,11 @@ function createPasswordResetMutations(fetcher) {
333
330
  const { gqlMutate } = fetcher;
334
331
  async function sendPasswordResetEmail(input) {
335
332
  const data = await gqlMutate(GQL_SEND_PASSWORD_RESET_EMAIL, { input });
336
- return data.sendPasswordResetEmail;
333
+ const result = data.sendPasswordResetEmail;
334
+ if (!result.success) {
335
+ throw new WPGraphQLError(ErrorCode.GQL_ERRORS_IN_RESPONSE, 200, "sendPasswordResetEmail", "User not found");
336
+ }
337
+ return result;
337
338
  }
338
339
  async function resetUserPassword(input) {
339
340
  const data = await gqlMutate(GQL_RESET_USER_PASSWORD, { input });