Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Rahul Chaudhari
    I know it is git ignored but how can I run the setup on my machine. What is the terminology behind this?

    Hey folks, just installed aws-amplify, and I get the following error:

    Module not found: Can't resolve './graphql' in '/Users/fk/Desktop/aws/mvp/frontend/node_modules/graphql'

    Any ideas why this is happening? I am running the web pack dev server and this error gets thrown

    Zach Wentz
    Anyone running into an issue where amplify-cli won't refresh token when they run amplify push?
    ~$: amplify push
    ⠹ Fetching updates to backend environment: develop from the cloud.Failed to refresh tokens.
    Failed to get credentials.
    NotAuthorizedException: Refresh Token has expired
        at Request.extractError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/protocol/json.js:52:27)
        at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
        at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
        at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:688:14)
        at Request.transition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:22:10)
        at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
        at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:26:10
        at Request.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:38:9)
        at Request.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:690:12)
        at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
      code: 'NotAuthorizedException',
      time: 2021-01-11T22:15:48.134Z,
      requestId: 'd72f914e-5c18-43e9-af77-04054e195abc',
      statusCode: 400,
      retryable: false,
      retryDelay: 50.82003610997183
    I've reset ~/.aws/credentials [default] and have verified the secret and access key are correct and have the right permissions.
    Zach Wentz
    amplify logout --appId XXXXXX and then amplify configure --appId XXXXX --env development did it for me.
    re: amplify function build, I checked the contents of dist/latest-build.zip and it's huge, contains a lot of raw source code and comes in over 100MB+
    is there any way to optimize the asset before deployment?
    I guess what I'll do is create a new folder under amplify/backend/function/<name>/real_src where the original source code goes, and then in src I'll use the amplify:<name> script to build and copy over a rollup-optimized JS bundle
    John Bell
    Hello. Any good examples/tutorials for using React-redux with Amplify? Namely AppSync? I did find this one, but not clear on how the state and AmplifyBridge work together. I don't understand the coupling.
    Can I expose my amplify api under a custom domain?
    I have a website too, i was thinking of trying to create a 200 rewrite in Console and redirecting to the URL of the backend API... but not sure if that will work..
    1. do amplify console rewrites support absolute URLs?
    2. what happens if the graphql API endpoint URL changes in a subsequent push?
    Oh darn, so it does work but it doesn't have branch support
    Rigal Patel

    AWS Amplify GraphQL Query Filter data based on the relational model field

    I create Post and rating model and I want to list all posts but exclude posts in which user already give ratings.

    I created below models

    type Post @model @key(name: "postsByUserId", fields: ["authorId"]) {
    id: ID!
    authorId: ID!
    content: String!
    postImage: String
    author: User @connection(fields: ["authorId"])
    rating: [Rating] @connection(keyName: "ratingByUserId", fields: ["authorId"])

    type Rating
    @key(name: "ratingByPostId", fields: ["postId"])
    @key(name: "ratingByUserId", fields: ["userId"]) {
    id: ID!
    postId: ID!
    userId: ID!
    rating: String!
    user: User @connection(fields: ["userId"])
    post: Post @connection(fields: ["postId"])

    query MyQuery {
    listPosts(filter: {not: {userId: {ne: ""}}}) {
    items {
    rating {
    items {

    I tried above query but it's not working

    I appreciate it if someone can help me with this.

    Raul Cajias
    hey all, I'm struggling with federated signin using AmplifySignIn UI component. I'm able to do the sign in, but get a
    "TypeError: user.getSession is not a function"
    error right away. Any ideas?
    1 reply
    Raul Cajias
    @Ajwah where you able to find a solution?
    how to make aws amplify username(email) case insensitive? ATM it is case senstive Auth.signIn({
    username: username,
    password: password
    3 replies
    @rathoregee I haven't looked into it but a real quick/nasty way would be to lowercase username input for both signIn and signUp functions + update existing user records. Or if also using appsync/api then maybe a matching table that contains the lowercased username and real/proper username, then use that real username when signing in
    Ismail Seyfi

    I have a demo app in android that I am trying to use to authenticate with cognito. It is used the Amplify.Auth.signInWithWebUI call. My configuration has both CognitoUserPool and CognitoIdentityPool defined. I can debug the application and see that OAUTH2Tokens successful return. With federation configuration (federated identities), I see session created successful. After all of this done, AwsMobileClient throws the following exception.
    2021-01-27 18:55:29.133 15485-15631/com.test.cognitoauthpoc W/AWSMobileClient: signalTokensNotAvailable
    2021-01-27 18:55:29.135 15485-15631/com.test.cognitoauthpoc W/AWSMobileClient: Tokens are invalid, please sign-in again.
    java.lang.Exception: No cached session.
    at com.amazonaws.mobile.client.AWSMobileClient$11$1.signalTokensNotAvailable(AWSMobileClient.java:1873)
    at com.amazonaws.mobile.client.AWSMobileClient$11$1.getAuthenticationDetails(AWSMobileClient.java:1853)
    at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getSession(CognitoUser.java:1032)
    at com.amazonaws.mobile.client.AWSMobileClient$11.run(AWSMobileClient.java:1834)
    at com.amazonaws.mobile.client.internal.InternalCallback.await(InternalCallback.java:115)
    at com.amazonaws.mobile.client.AWSMobileClient.getTokens(AWSMobileClient.java:1800)
    at com.amazonaws.mobile.client.AWSMobileClient.getUserStateDetails(AWSMobileClient.java:1046)
    at com.amazonaws.mobile.client.AWSMobileClient$24$1$1$1.onResult(AWSMobileClient.java:3160)
    at com.amazonaws.mobile.client.AWSMobileClient$24$1$1$1.onResult(AWSMobileClient.java:3156)
    at com.amazonaws.mobile.client.internal.InternalCallback.call(InternalCallback.java:75)
    at com.amazonaws.mobile.client.internal.InternalCallback.onResult(InternalCallback.java:62)
    at com.amazonaws.mobile.client.AWSMobileClient$10.run(AWSMobileClient.java:1722)
    at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
    at java.lang.Thread.run(Thread.java:923)

    this is coming from userpool.getCurrentUser().getSession(). --- userpool.getCurrentUser() has the following definition.

    public CognitoUser getCurrentUser() {
    final String csiLastUserKey = "CognitoIdentityProvider." + clientId + ".LastAuthUser";

        if (awsKeyValueStore.contains(csiLastUserKey)) {
            return getUser(awsKeyValueStore.get(csiLastUserKey));
        } else {
            return getUser();
    2 replies
    that key does not exist. so it gets a user with userId being null which causes session to blow up.
    here is all I have in my main activity..
    this, options,
    { result: AuthSignInResult ->
    Log.i(TAG, result.toString())
        // fetch session details (incl token)
          { result -> Log.i(TAG, result.toString()) },
          { error -> Log.i(TAG, error.toString()) }
        // get user details
        val user = Amplify.Auth.currentUser
        Log.i(TAG, user.toString())
      { error: AuthException ->
        Log.e(TAG, error.toString())
        throw error
    I have searched online but with no direct guidance. if any one here can point me in the right direction, I can appreciate it.
    Ronique Ricketts
    Kevin Mitchell
    John Bell
    Hello. I am trying to understand Custom Pipeline Resolvers for AppSync GraphQL. How to have default resolver for all fields except one, which should be a lambda resolver. All current fields, and future fields should use default resolver. One single field should use a lambda resolver and not interact with default resolver on query and mutation. Is this possible? This needs to happen at the query/mutation level not schema type level i believe. Any help, guides or resources?
    John Bell
    Current attempts are 1) Add lambda resolver at type level, works but data also get handled by default resolver. 2) At query level, all fields must be handled in lambda not just field of interest. I suspect this is a VTL knowledge issue any help appreciated.
    Jasmin Parent
    Hi, please help me with this simple issue if you kow about appsync's template language: aws/aws-appsync-community#151
    Hi guys! Anyone is experiencing an issue with AWSEmail and amplify mock api: {"errors":[{"message":"Unknown type \"AWSEmail\". Did you mean \"AWSDate\"?","locations":[{"line":1,"column":23}]}],"data":null}
    doyeon kim
    스크린샷 2021-02-22 오후 6.15.57.png
    Hi guys! i was successfully deployed the first project in amplify. but trying second one got an error with exactly same code. Any idea where to check?
    well it says The requested URL returned error: 403
    Has anyone recently tried the Amplify Getting Started guide for Angular? I am at the part when I try to connect to the database. this.api.ListCustomers().then(event => { this.customers = event.items; }); and it is throwing issues.
    its giving me the error: "Type 'undefined' is not assignable to type 'Resturant[]'.ts(2322)
    I know I have strict typescripting enabled but if I disable it and run it in the browser it doesn't work. I receive Error: Uncaught (in promise): Object: {"data":{"listRestaurants":
    Does anyone have a good Amplify Angular GraphQL delete example?
    Khyati Sehgal
    Hey guys, I am using wdio with mocha & Typescript I am trying to run my code on AWS Amplify - getting this error during Test phase of it- "fsevents@2.3.2: The platform "linux" is incompatible with this module."
    any one has any idea about it I can share across the amplify.yml file for reference
    Hi guys, how do we configure OIDC (OpenId connect) in amplify-flutter package? I am using firebase the idP but not sure how to configure it though. Specifically, OIDC is the default authorization mode for my appsync API. How do I call it from my flutter app? Any help is appreciated. Thanks!
    David Cheal
    Hi all, I was wondering if anyone had gotten Amplify / Cognito / ApiGateway Websocket IAM Auth working?
    At the moment I have a working React > Amplify > Cognito solution and want to auth against APIGW websocket, but that appears too need a signed URL using Amplify SignUrl. The trouble I have is that my authenticated identity only has cognito details and no access to secret key needed for SignUrl.
    Has anyone managed to make this work?
    john williams
    Seek Political candidate web site with UI integrations with Amazon Cognito(hosted UI) and Amazon Lex (chatbot). (No time to build the front end from scratch.) Thanks for your suggestions.
    Remeez Persent

    Does anyone have a good Amplify Angular GraphQL delete example?

    @TestPilot2321 I am busy with the same issue at the moment, what I have discovered is that it sets the _deleted flag on the object to true. When requesting the list after the delete it still shows up and I can't seem to filter out the deleted items without fetching every item.

    Remeez Persent
    Hi All, does anyone know how to filter items in a list i.e. this.api.ListRestaurants(filter: filter). I am trying to fetch the list of restaurants filtering out deleted records using _deleted flag using the angular sdk.
    is this still being managed by Amplify team? the chat link on Amplify github seems to link to discord now
    David Cheal

    Hi all, I was wondering if anyone had gotten Amplify / Cognito / ApiGateway Websocket IAM Auth working?
    At the moment I have a working React > Amplify > Cognito solution and want to auth against APIGW websocket, but that appears too need a signed URL using Amplify SignUrl. The trouble I have is that my authenticated identity only has cognito details and no access to secret key needed for SignUrl.
    Has anyone managed to make this work?

    To answer my own question, I needed Cognito Identity Pool as well as Cognito User Pools to use AWS creds

    Matthew Merryfull
    I'm developing an ionic app with amplify stack. Ionic5, amplify@latest, angular9, capacitor. Double, triple checked for single use of Amplify.configure(), but token endpoint is being called twice in a row on Android app. If initialised with Auth.configure(), no problem at all, but then I can't use API, storage etc. Docs have proven fruitless. Help. Please!
    Eric DeCoff
    Hey all have a request to create api/v1/login to call aws-amplify login... anyone got a good example I can build off of?
    Any way to perform update mutation using Amplify GraphQL client via the onChange event handler. Ex. Update string field in database from the text input component . It only seems the capture the first onChange event but the ones after don't appear to update string field in database

    Hi there,
    I'm getting stuck and looking for a way to assign properties when updating an existing record by key name. Due to other constraints, the property to be assigned is programmatically provided as follows:

    const diff = {title: "new title"};
    const original = await DataStore.query(Post, "123");
    await DataStore.save(
      Post.copyOf(original, updated => {
        const key = "title";
        updated[key] = diff[key];  // <--- error

    However, the typescript compiler gives the following error.

    Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Pick<DeepWritable<Post>, "title" | "rating" | "status">'.
      No index signature with a parameter of type 'string' was found on type 'Pick<DeepWritable<Post>, "title" | "rating" | "status">'.Vetur(7053)

    Is there any workaround?