By using AWS re:Post, you agree to the Terms of Use

Questions tagged with AWS Amplify

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Querying an index with Android Amplify GraphQL

I'm trying to perform a GraphQL query against an index using Amplify and the Android SDK. I have a query that works when tested via the AppSync dashboard. It returns the one record I can see in DynamoDB that it should match against. **membersEmailByInviteCode** is an index defined in the Schema. ``` query get { membersEmailByInviteCode(email: "test@example.com" inviteCode: { eq: "CustomCode"} ) { items { id } } } ``` When I enable CloudWatch Logs and run the query from within the code I can see the following being sent, but I get an empty object back, which I'm guessing means that it hasn't been able to find anything. ``` query get($email: String!, $code: String!) { membersEmailByInviteCode(email: $email inviteCode: { eq: $code} ) { items { id } } }, Operation: null, Variables: { "email": "test@example.com", "code": "CustomCode" } ``` Operation is **null**, where it is **get** if I run the query via the console. I can't see a way of settings this. The Android side of things look like this ``` private fun getEmailCodeRequest(email: String, code: String): GraphQLRequest<ClubMember> { val document = ( "query get(\$email: String!, \$code: String!) { " + "membersEmailByInviteCode(email: \$email inviteCode: { eq: \$code} ) { " + "items { " + "id " + "} " + "} " + "}") return SimpleGraphQLRequest( document, mapOf("email" to email, "code" to code), ClubMember::class.java, GsonVariablesSerializer()) } ``` and ``` Amplify.API.query(getEmailCodeRequest(email.text.toString(), code.text.toString()), ``` I have been able to create a record using GraphQL, and I'm using auth and Rest API, so my app is working OK with the Android SDK. It just I can't get this to work. Anyone got any ideas? Thanks
1
answers
0
votes
11
views
asked 6 days ago

Removed wrong IAM roles

I destroyed some IAM roles since they did not display a "last active" attribute. Now I cannot access my data properly. When I try to reset my auth settings, I cannot: ``` NoSuchEntity - An error occurred while processing your request: The role with name us-east-1_g9F10WnFw_Manage-only cannot be found. ``` I'm struggling to figure out what Roles to recreate what access to give them to access my amplify environment Not sure if this helps but here is my aws-export.js: ``` /* eslint-disable */ // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten. const awsmobile = { "aws_project_region": "us-east-1", "aws_appsync_graphqlEndpoint": "https://iai3fj7vd5hgjc22z4m7kj5tn4.appsync-api.us-east-1.amazonaws.com/graphql", "aws_appsync_region": "us-east-1", "aws_appsync_authenticationType": "API_KEY", "aws_appsync_apiKey": "da2-****", "aws_cognito_identity_pool_id": "us-east-1:0afc5fb7-9bb5-45a0-ad98-50a9a38491c0", "aws_cognito_region": "us-east-1", "aws_user_pools_id": "us-east-1_eW3yGAOvZ", "aws_user_pools_web_client_id": "7al4qgvvsu8qkicdsqtl9n4stv", "oauth": {}, "aws_cognito_username_attributes": [ "EMAIL" ], "aws_cognito_social_providers": [], "aws_cognito_signup_attributes": [], "aws_cognito_mfa_configuration": "OFF", "aws_cognito_mfa_types": [ "SMS" ], "aws_cognito_password_protection_settings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [ "REQUIRES_LOWERCASE", "REQUIRES_NUMBERS", "REQUIRES_SYMBOLS", "REQUIRES_UPPERCASE" ] }, "aws_cognito_verification_mechanisms": [ "EMAIL" ], "aws_user_files_s3_bucket": "gr-movement-storage-e48b8b36191308-staging", "aws_user_files_s3_bucket_region": "us-east-1" }; export default awsmobile; ```
1
answers
0
votes
23
views
asked 10 days ago