Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs in buildMutation function when calling a Mutation #363

Open
ChrisFieldsII opened this issue Feb 21, 2019 · 4 comments
Open
Labels
investigating Amplify is looking into the issue

Comments

@ChrisFieldsII
Copy link

Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the
official AWS AppSync forum

Do you want to request a feature or report a bug?
Report a possible bug.

What is the current behavior?
Calling a graphlQL mutation causes an error in aws-appsync/helpers/offline in buildMutation. The error is caused by the variablesInfo param not having the required attribute inputType. I have added a screenshot of the debugger paused at the line where the error occurs. The Watch window pane shows the values of isVariablesInfo and variablesInfo.
screen shot 2019-02-21 at 2 31 40 pm

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I have created 2 different AppSync projects that both have this same problem for react-native by first doing:

  1. react-native init <proj-name>
  2. cd proj-name and then amplify init
  3. amplify add api
  4. Edit schema
  5. amplify push
  6. Following the documentation for setting up the AWS AppSync Client and using offline-helpers. Here is a link to the React-Native example I have done.

What is the expected behavior?
Using a GraphQL mutation doesn't error out due to the missing field.

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?

Package Dependencies:
"dependencies": {
"aws-amplify": "^1.1.19",
"aws-appsync": "1.6.0",
"aws-appsync-react": "^1.2.6",
"faker": "^4.1.0",
"graphql-tag": "^2.10.1",
"react": "16.6.3",
"react-apollo": "^2.4.1",
"react-native": "0.58.5"
},

I am using React-Native. Here is the react-native info
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Memory: 80.42 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.5 => 0.58.5

@elorzafe
Copy link
Contributor

@ChrisFieldsII Can you paste your schema, and mutation your are trying to do? Thanks!

@elorzafe elorzafe added the investigating Amplify is looking into the issue label Feb 28, 2019
@ChrisFieldsII
Copy link
Author

Hello @elorzafe . Thanks for the reply.

Schema:
schema.txt
updatescope
createphoto
cameracontainer
camera

The first 2 images are the Mutations I am trying to run. The updateScope mutation works just fine and I do not get the error. The createPhoto mutation is the one that errors out due to inputType not being present.
The third image is the container that just passes the Mutation functions into its View component.
The fourth image is the View component Camera calling the mutation functions with the variables

@ChrisFieldsII
Copy link
Author

Hello,

Has there been any luck recreating the error or anyone else that has experienced it?

I am still running into the same error when calling mutations via the graphqlMutation helper. variablesInfo just contains the variables object passed in when calling the mutation function in my client code causing the error.

I am currently commenting out the code and setting inputTypeVersionField to false

@torigeorge
Copy link

@elorzafe @ChrisFieldsII I'm having the same issue on isVariablesInfo and variablesInfo. Did you find a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating Amplify is looking into the issue
Projects
None yet
Development

No branches or pull requests

3 participants