aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

Amplify graphQL API update query is not working. #9017

Closed amneeshsoftobiz closed 2 years ago

amneeshsoftobiz commented 2 years ago

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

GraphQL API

Amplify Categories

storage, api

Environment information

``` # Put output below this line System: OS: Windows 10 10.0.22000 CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz Memory: 2.82 GB / 15.75 GB Binaries: Node: 16.1.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.11 - C:\Program Files\nodejs\yarn.CMD npm: 7.11.2 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.22000.120.0), Chromium (94.0.992.38) Internet Explorer: 11.0.22000.120 npmPackages: <%= name %>: <%= version %> @aws-amplify/datastore: ^3.4.3 => 3.4.3 @azure/msal-browser: ^2.14.2 => 2.17.0 @azure/msal-node: ^1.2.0 => 1.3.1 (1.0.0-beta.6) @azure/msal-react: ^1.0.0 => 1.0.2 @compodoc/compodoc: ^1.1.11 => 1.1.14 @fullcalendar/daygrid: ^5.8.0 => 5.9.0 @fullcalendar/react: ^5.8.0 => 5.9.0 @microsoft/microsoft-graph-client: ^2.2.1 => 2.2.1 @my/fake-basic-project: 1.0.0 @nestjs-modules/mailer: ^1.6.0 => 1.6.0 @nestjs/axios: ^0.0.1 => 0.0.1 @nestjs/cli: ^7.6.0 => 7.6.0 @nestjs/common: 7.6.15 => 7.6.15 @nestjs/config: ^0.6.3 => 0.6.3 @nestjs/core: 7.6.15 => 7.6.15 @nestjs/event-emitter: ^1.0.0 => 1.0.0 @nestjs/jwt: ^7.2.0 => 7.2.0 @nestjs/mongoose: ^7.2.4 => 7.2.4 @nestjs/passport: ^7.1.5 => 7.1.6 @nestjs/platform-express: ^7.6.15 => 7.6.18 @nestjs/platform-socket.io: ^8.0.0 => 8.0.6 @nestjs/platform-ws: ^8.0.6 => 8.0.6 @nestjs/schedule: ^1.0.0 => 1.0.1 @nestjs/schematics: ^7.3.1 => 7.3.1 @nestjs/swagger: ^4.8.0 => 4.8.2 @nestjs/testing: ^7.6.15 => 7.6.18 @nestjs/typeorm: ^7.1.5 => 7.1.5 @nestjs/websockets: ^8.0.0 => 8.0.6 @sentry/node: ^6.13.3 => 6.13.3 @sentry/react: ^6.13.3 => 6.13.3 @sentry/tracing: ^6.13.3 => 6.13.3 @storybook/addon-actions: ^6.2.9 => 6.3.8 @storybook/addon-essentials: ^6.2.9 => 6.3.8 @storybook/addon-links: ^6.2.9 => 6.3.8 @storybook/node-logger: ^6.2.9 => 6.3.8 @storybook/preset-create-react-app: ^3.1.7 => 3.2.0 @storybook/react: ^6.2.9 => 6.3.8 @tensorflow-models/body-pix: ^2.2.0 => 2.2.0 @tensorflow/tfjs: ^3.6.0 => 3.9.0 @tensorflow/tfjs-converter: ^3.6.0 => 3.9.0 @tensorflow/tfjs-core: ^3.6.0 => 3.9.0 @testing-library/jest-dom: ^5.12.0 => 5.14.1 @testing-library/react: ^11.2.7 => 11.2.7 @testing-library/user-event: ^13.1.9 => 13.2.1 @types/bcrypt: ^5.0.0 => 5.0.0 @types/classnames: ^2.3.1 => 2.3.1 @types/cron: ^1.7.3 => 1.7.3 @types/express: ^4.17.11 => 4.17.13 @types/jest: ^26.0.23 => 26.0.24 (27.0.1) @types/lodash: ^4.14.169 => 4.14.172 @types/node: ^16.4.0 => 16.9.1 (14.17.15, 10.17.60, 9.6.61) @types/passport-jwt: ^3.0.5 => 3.0.6 @types/passport-local: ^1.0.33 => 1.0.34 @types/react: ^17.0.5 => 17.0.20 @types/react-dom: ^17.0.5 => 17.0.9 @types/react-redux: ^7.1.16 => 7.1.18 @types/react-redux-toastr: ^7.6.0 => 7.6.1 @types/react-router: ^5.1.14 => 5.1.16 @types/react-router-config: ^5.0.2 => 5.0.3 @types/react-router-dom: ^5.1.7 => 5.1.8 @types/react-router-redux: ^5.0.18 => 5.0.19 @types/redux: ^3.6.0 => 3.6.0 @types/redux-form: ^8.3.1 => 8.3.2 @types/redux-logger: ^3.0.8 => 3.0.9 @types/redux-thunk: ^2.1.0 => 2.1.0 @types/superagent: ^4.1.11 => 4.1.12 @types/supertest: ^2.0.11 => 2.0.11 amazon-chime-sdk-js: 2.16.1 => 2.16.1 amazon-cognito-identity-js: ^5.0.1 => 5.1.0 aws-amplify: ^4.2.9 => 4.2.9 aws-sdk: 2.981.0 => 2.981.0 (2.988.0) bcrypt: ^5.0.1 => 5.0.1 chardet: ^1.3.0 => 1.3.0 (0.7.0) class-transformer: ^0.4.0 => 0.4.0 class-validator: ^0.13.1 => 0.13.1 classnames: ^2.3.1 => 2.3.1 cross-fetch: ^3.1.4 => 3.1.4 cross-fetch-polyfill: 0.0.0 crypto-js: ^4.0.0 => 4.1.1 dayjs: ^1.10.6 => 1.10.7 ejs: ^3.1.6 => 3.1.6 (2.7.4) fake-basic-project: 1.0.0 fake-project: 1.0.0 file-type: ^16.5.2 => 16.5.3 (5.2.0, 6.2.0, 3.9.0) formik: ^2.2.6 => 2.2.9 googleapis: ^81.0.0 => 81.0.0 handlebars: ^4.7.7 => 4.7.7 helmet: ^4.6.0 => 4.6.0 image-to-blob: ^0.2.0 => 0.2.0 jest: 26.6.0 => 26.6.0 js-file-download: ^0.4.12 => 0.4.12 jwk-to-pem: ^2.0.5 => 2.0.5 jwks-rsa: ^2.0.3 => 2.0.4 local-video-effector: ^1.0.39 => 1.0.39 lodash: ^4.17.21 => 4.17.21 markdown-it: ^12.0.6 => 12.2.0 microphone-stream: ^6.0.1 => 6.0.1 moment: ^2.29.1 => 2.29.1 moment-timezone: ^0.5.33 => 0.5.33 mongoose: ^5.12.9 => 5.13.9 msal: ^1.4.11 => 1.4.12 mssql: ^7.1.0 => 7.2.1 mysql: ^2.18.1 => 2.18.1 nanoid: ^3.1.23 => 3.1.25 nest-winston: ^1.5.0 => 1.6.0 node-fetch: ^2.6.1 => 2.6.2 (2.6.1, 1.7.3) node-sass: ^6.0.0 => 6.0.1 nodemailer: ^6.6.2 => 6.6.3 passport: ^0.4.1 => 0.4.1 passport-jwt: ^4.0.0 => 4.0.0 passport-local: ^1.0.0 => 1.0.0 pdf2pic: ^2.1.4 => 2.1.4 prettier: ^2.3.0 => 2.4.0 (2.2.1) pug: ^3.0.2 => 3.0.2 react: ^17.0.2 => 17.0.2 (15.7.0) react-awesome-slider: ^4.1.0 => 4.1.0 react-calendar: ^3.4.0 => 3.4.0 react-date-picker: ^8.2.0 => 8.3.2 react-dom: ^17.0.2 => 17.0.2 (15.7.0) react-google-calendar-api: ^1.4.0 => 1.4.0 react-google-charts: ^3.0.15 => 3.0.15 react-https-redirect: ^1.1.0 => 1.1.0 react-loadable: ^5.5.0 => 5.5.0 react-loader-spinner: ^4.0.0 => 4.0.0 react-multi-carousel: ^2.6.3 => 2.6.5 react-phone-number-input: ^3.1.25 => 3.1.27 react-phone-number-input-core: 1.0.0 react-phone-number-input-flags: 1.0.0 react-phone-number-input-input-core: 1.0.0 react-phone-number-input-input-max: 1.0.0 react-phone-number-input-input-min: 1.0.0 react-phone-number-input-input-mobile: 1.0.0 react-phone-number-input-max: 1.0.0 react-phone-number-input-min: 1.0.0 react-phone-number-input-mobile: 1.0.0 react-phone-number-input/react-hook-form: 1.0.0 react-phone-number-input/react-hook-form-core: 1.0.0 react-phone-number-input/react-hook-form-input: 1.0.0 react-phone-number-input/react-hook-form-input-core: 1.0.0 react-phone-number-input/react-native-input: 1.0.0 react-redux: ^7.2.4 => 7.2.5 react-redux-toastr: ^7.6.5 => 7.6.5 react-responsive-carousel: ^3.2.18 => 3.2.21 react-router: ^5.2.0 => 5.2.1 react-router-config: ^5.1.1 => 5.1.1 react-router-dom: ^5.2.0 => 5.3.0 react-router-redux: ^4.0.8 => 4.0.8 react-s3-uploader: ^5.0.0 => 5.0.0 react-scripts: ^4.0.3 => 4.0.3 react-semantic-ui-datepickers: ^2.13.1 => 2.13.2 react-stepper-horizontal: ^1.0.11 => 1.0.11 react-webcam: ^6.0.0 => 6.0.0 redux: ^4.1.0 => 4.1.1 redux-form: ^8.3.7 => 8.3.7 redux-localstorage-simple: ^2.4.0 => 2.4.1 redux-logger: ^3.0.6 => 3.0.6 redux-thunk: ^2.3.0 => 2.3.0 reflect-metadata: ^0.1.13 => 0.1.13 rimraf: ^3.0.2 => 3.0.2 (2.7.1) rxjs: ^7.0.1 => 7.3.0 (6.6.3, 6.6.7) rxjs/ajax: undefined () rxjs/fetch: undefined () rxjs/internal-compatibility: undefined () rxjs/operators: undefined () rxjs/testing: undefined () rxjs/webSocket: undefined () semantic-ui-css: ^2.4.1 => 2.4.1 semantic-ui-react: ^2.0.3 => 2.0.3 slick-carousel: ^1.8.1 => 1.8.1 socket.io-client: ^4.1.2 => 4.2.0 sonar-scanner: ^3.1.0 => 3.1.0 sonarqube-scanner: ^2.8.1 => 2.8.1 store2: ^2.12.0 => 2.12.0 superagent: ^6.1.0 => 6.1.0 superagent-intercept: ^0.1.2 => 0.1.2 supertest: ^6.1.3 => 6.1.6 swagger-ui-express: ^4.1.6 => 4.1.6 ts-jest: ^26.5.6 => 26.5.6 ts-loader: ^9.1.2 => 9.2.5 ts-node: ^9.1.1 => 9.1.1 tsconfig-paths: ^3.9.0 => 3.11.0 (3.9.0) tslint: ^6.1.3 => 6.1.3 typeorm: ^0.2.32 => 0.2.37 typescript: ^4.2.4 => 4.4.3 (4.2.3) uuid: ^8.3.2 => 8.3.2 (3.4.0, 3.3.2, 8.3.1) uuidv4: ^6.2.8 => 6.2.12 winston: ^3.3.3 => 3.3.3 winston-cloudwatch: ^3.0.1 => 3.0.2 npmGlobalPackages: @aws-amplify/cli: 5.4.0 aws-cli: 0.0.2 npm: 7.11.2 serve: 12.0.0 server: 1.0.35 yarn: 1.22.11 ```

Describe the bug

here is my screenshot from AWS app sync, same mutation i am using in my code, both are not updating, you can see i am trying to update "time" in store.

image

as you can i am not getting update value of time

{
  "data": {
    "updateMeetingMinutesOfSpeech": {
      "id": "cff78fca-47cb-4e4f-8d1f-72e37acd876c",
      "meetingTitle": "As79DbV",
      "time": 0,
      "attendeeID": "61239af201bce836180a9f5e"
    }
  }
}

Expected behavior

i was trying to update the value of "time" to "3" from "0" where id is "cff78fca-47cb-4e4f-8d1f-72e37acd876c"; but i am getting update value is 0 not 3.

getting success on the API but data is not getting updated. expected result should be

{
  "data": {
    "updateMeetingMinutesOfSpeech": {
      "id": "cff78fca-47cb-4e4f-8d1f-72e37acd876c",
      "meetingTitle": "As79DbV",
      "time": 3,
      "attendeeID": "61239af201bce836180a9f5e"
    }
  }
}

Reproduction steps

  1. go to app sync
  2. try to run the mutation updateMeetingMinutesOfSpeech
  3. value is not update in the response and the list also

Code Snippet

// Put your code below this line.
const input = {
   id: "cff78fca-47cb-4e4f-8d1f-72e37acd876c",
   time: 3
 };
 API.graphql({ query: updateMeetingMinutesOfSpeech, variables: { input } });

Log output

``` // Put your logs below this line ```

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

chrisbonifacio commented 2 years ago

Hi @amneeshsoftobiz 👋 Thank you for raising this issue. Can you share your schema (amplify/backend/api/schema.graphql) so that I can attempt to reproduce this issue?

chrisbonifacio commented 2 years ago

Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you. Thank you!

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.