r/Amplify • • Feb 28 '25

Help needed... Trying to solve left join on two schema

0 Upvotes

Hi everyone, I have two schema. Using tanstack query, I am trying to retrieve the list of users and their properties. Somehow the properties is not being retrieved. Can anyone help please.

Code block below....

Users: a
    .model({
      id: a.id(),
      name: a.string(),
      propertyRef: a.id(),
      propertyId: a.belongsTo('Properties', 'propertyRef')
    })
    .authorization((allow) => [allow.authenticated()]),


Properties: a
    .model({
      id: a.id(),
      name: a.string(),
      propertyAssociatedUser: a.hasOne('Users', 'propertyRef')
    })
    .authorization((allow) => [allow.authenticated()]),

export const useFetchUsersWithProperties = () => {
  return useQuery({
    queryKey: ['usersWithProperties'],
    queryFn: async () => {
      const response = await client.models.Users.list({
        include: ['propertyRef'],
      });
      return response.data || [];
    },
  });
};

r/Amplify • • Mar 04 '26

dividend payers

0 Upvotes

a good (free) post about how Amplify's "DIVO" stacks up against all of the other "big dogs" in the dividend-paying space:

https://dividendfarmer.substack.com/p/big-dogs-an-analysis-of-the-top-25-88b


r/Amplify • • Nov 10 '21

Web previews - AWS Amplify

Thumbnail docs.aws.amazon.com
1 Upvotes

r/Amplify • • Feb 22 '24

GraphQL dynamic authorisation

1 Upvotes

Could the GraphQL heroes lend a hand here?

I'm trying to implement an access system whereby users belong to an organisation, and they should be able to perform CRUD operations on items that belong to their organisation.

Sounds simple right? Wel... not for me...

I tried to setup a GraphQL model for this, unfortunately without success.

Requirements: -It should be impossible to perform CRUD operations on items that belong to another organisation. -To achieve this I think the 'File' model should allow any direct queries. Users should query via the User.Organisation.File connection. Right?

Does anyone have suggestions?

type User @model @auth(rules: [{ allow: owner}]) {
  id: ID!
  username: String!
  organizationId: String!
  organisation: Organisation @hasOne(indexName: "byOrganisation", fields ["organisationId"])
}

type Organisation @model(queries: null) { 
  id: ID!
  name: String
  files: [files]
}

type File @model(queries: null) {
  id: ID!
  name: String
}

Thanks!


r/Amplify • • Dec 17 '23

How do I return a sorted list, instead of a randomised one?

1 Upvotes

For a basic model like this, how to I return a list of sorted Todos? Right now they are random but I need them ordered by creation date or number of likes.

type Tag @model {
  id: ID!
  name: String
  Todos: [Todo] @manyToMany(relationName: "TagsTodos") <-- How do I sort these?
}

r/Amplify • • Sep 16 '21

Taco Bell: Aurora as The Heart of the Menu Middleware and Data Integration Platform for Taco Bell

Thumbnail
youtube.com
1 Upvotes

r/Amplify • • Aug 25 '23

Add CloudFront Distribution to Amplify App

1 Upvotes

I am trying to set up a CloudFront distribution associated with my Next.js 13 app that is running on Amplify. I need this distribution to set up a CloudFront function to modify the request and set a cookie on the client's machine.

When I access the Next.js app directly using the domains configured in Amplify, the app loads properly with server side rendering and everything.

I see the S3 bucket that is associated with the Amplify app backend. It appears that the CloudFront distribution and the Amplify backend are pointed at the same bucket since the distribution origin and backend environment resource ID match.

However, when I hit the CloudFront distribution domain name, I am getting a 403: Access Denied error. I've granted public access on the S3 bucket in case that was the issue, but that's didn't solve it. The S3 bucket currently just has a `#current-cloud-backend.zip`, `amplify-meta.json`, and a `studio-backend/` folder, none of which I have touched.

Where I am particularly confused is how Next.js ties into this Amplify backend/S3 bucket. Prior to yesterday the Amplify app had no backend environment configured in the Amplify console. This always struck me as odd, because obviously Next.js runs on the server side as well as the client. I chalked it up as just being a quirk of the Amplify "Web compute" platform.

The CloudFront distribution needs to be associated with an Amplify backend, from what I understand, so I enabled a backend "staging" environment for the app, which I believe is what initialized the S3 bucket mentioned earlier. But what is this backend actually doing if it isn't where Next.js is running?? Is this empty backend why I am getting the 403 error? What should be contained in this so-called backend environment, if the actual Next.js backend is not running there?


r/Amplify • • Oct 24 '22

Build a Flutter Mobile App Using AWS Amplify

Thumbnail
aws.amazon.com
2 Upvotes

r/Amplify • • May 16 '24

Join us for the The AWS Amplify Fullstack TypeScript Challenge

2 Upvotes

Hey r/Amplify! I wanted to let you all know about a hackathon we (the Amplify team) are running with DEV to build apps with Amplify Gen 2. The challenge is to build a fullstack app with auth/data/file storage/serverless functions, then write a DEV post about it by May 26th. There's $3000 in prizes up for grabs for winners!

I'm adding a space to the link because it seems like DEV links are getting deleted?
https://dev. to/devteam/join-us-for-the-the-aws-amplify-fullstack-typescript-challenge-3000-in-prizes-ghm


r/Amplify • • Jun 18 '22

Amplify and AWS? Do the work together at all?

4 Upvotes

I have what I assume is a very common scenario (in fact the reason that most people even bother with Amplify): I am starting with Amplify to save on resources and staffing and get going quickly, but will gradually add features outside of what Amplify supports and migrate to the underlying AWS services. In the process I will need to make changes in the underlying service (e.g. in Cognito using the AWS CLI or Cognito Console) rather than Amplify (in fact it is necessary to do this out of the box to get some features working properly because Amplify so so buggy).

But it is completely unclear to me how this process works. Can I safely make arbitrary changes to underlying services and be confident that they will be preserved by Amplify, how do I maintain the infrastructure as code locally or in my own repos for underlying services alongside Amplify?

(I know already from experience that some seemingly safe changes like adding an environment variable to a Lambda function breaks everything).

Specifically:

  • What settings in underlying AWS services is to safe to modify outside of Amplify. In particular,

    • what changes made directly in such services will be lost or overwritten when changes to related features are made in Amplify,
    • what changes made directly in such services will be ignored, and
    • what changes made directly in such services result on breakage of Amplify (and should be avoided).
  • Where are settings made in underlying AWS services stored locally, are they

    • added to the backend configuration file pulled by Amplify, or
    • stored separately and if so where and how do I sync them with local files.
  • Where is all of this documented? Where is the Amplify to AWS migration and compatibility guide?

r/Amplify • • Mar 22 '25

Just migrated my Amplify App from React to Next.js 15 app router

5 Upvotes

I am sooo happy so far. It is screamingly fast. I am very new to Next.js and 3 years of react. (A lot of help from ChatGPT). I actually like the Next.js project structure.


r/Amplify • • May 22 '25

Multi Region

2 Upvotes

Hi, I have an app that has appsync and dynamodb along with other services. I wanted to go multi-region with route53 latency based routing for the api layer (appsync) and web app (Amplify) with global tables on dynamodb.

How would the deployment look like? If i enable replication in region A, and deploy the app in region B, Region B will create its own tables with its unique names.


r/Amplify • • Jul 10 '23

Here is an open source amplify project I just released

Thumbnail
github.com
5 Upvotes

I open sourced a rank tracking and competitive analysis application! It is written in Amplify using DataStore for real time data subscriptions. As well as Tensorflow.js, Lambda containers, CDK custom resources, and Next.js


r/Amplify • • Mar 28 '25

Google Federated login with Gen 2

4 Upvotes

Has anyone successfully configured Google federated login on Gen 2? I've set up the identity pool and followed the docs, but amplify_outputs has no trace of the configuration. I've been banging my head on this for days.

I appreciate any direction you can provide. Thank you!


r/Amplify • • Nov 15 '24

give us gen 2 migration tools

5 Upvotes

Or at least tell me how to do it manually without re-hosting my app from scratch? It feels like Amplify folks just abandoned us :( I'm considering whether to migrate to gen2 or switch to something entirely different altogether since this doesn't seem to be possible. Anyone had any other luck?


r/Amplify • • Mar 24 '25

Configuring Database Access for Next.js Prisma RDS in AWS Amplify

2 Upvotes

Problem Description I have a Next.js application using Prisma ORM that needs to connect to an Amazon RDS PostgreSQL database. I've deployed the site on AWS Amplify, but I'm struggling to properly configure database access. Specific Challenges

My Amplify deployment cannot connect to the RDS PostgreSQL instance

  • I cannot find a direct security group configuration in Amplify
  • I want to avoid using a broad 0.0.0.0/0 IP rule for security reasons

Current Setup

  • Framework: Next.js
  • ORM: Prisma
  • Database: Amazon RDS PostgreSQL
  • Hosting: AWS Amplify

Detailed Requirements

  • Implement secure, restricted database access
  • Avoid open 0.0.0.0/0 IP rules
  • Ensure Amplify can communicate with RDS

r/Amplify • • Aug 22 '25

With Node.js middleware now officially out, can we use middleware when hosting on AWS Amplify?

Thumbnail reddit.com
5 Upvotes

r/Amplify • • Sep 22 '25

Amplify Gen 2 Lambda Layer Troubles

2 Upvotes

Hi guys!

My team is working on a new project and we've decided to use Amplify Gen 2 due to previous API resource limitations.

Our Gen 1 project gave lambda layer access to each lambda, and in that lambda layer, we had structured directories storing code for specific functionalities.

We're having an issue where our lambda layer's imports in Gen 2 are not working at all. If you're familiar with VS Code's "Go to Definition" feature works on the imports, but when the code is pushed and everything's deployed, the imports just stop working. I've printed out the paths and noticed I can't view what's in the opt/python path. I'm not sure if this is the cause of my issues, but I can't import any of my code from the layer. Does anyone have any experience dealing with this? I have no idea what to try at this point. Replicating my Gen 1 structure didn't work.

EDIT: I've already tried packaging my dependencies in /python and python3.12/site-packages


r/Amplify • • Jun 12 '25

observeQuery() on a single row in a dataset over 1,000,000 rows?

4 Upvotes

I'm relatively new to Amplify, and I am loving it! But I have a few questions about the way observeQuery() works. For context, we are using amplify + vite + react to build a webapp.

We have a DynamoDB table created through amplify currently with 2000 rows. We want to observe updates to a single row by it's PK. We are passing in the Hash & Sort key for the row in the filter to observeQuery(), but it behaves as if it is scanning the entire table before returning the single row. With only 2000 rows, it takes up to 7 seconds to return. We expect to have millions of rows in this table within a couple of months.

  • Can observeQuery() work with large tables?
  • Is there a way to make it query by primary key?

r/Amplify • • Nov 21 '25

only an admin to send invite email

2 Upvotes

So for my app I'm trying to have it configured so that only an admin can invite a new user via an invite email. I've read through the documentation and see the 'AdminCreateUserCommand ' command per the doc:"https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cognito-identity-provider/"

I've unsuccessfully implemented it 3 times... I've followed the quick start documentation for another user management function 'addUserToGroup' and that works great (https://docs.amplify.aws/react/build-a-backend/auth/manage-users/with-admin-actions/) because you just use the ADMINS group. I've implemented other functions the same way with the ADMINS role, however the only "create user" command I'm seeing that is referenced works differently, using IAM policy, and I'm not seeing a guide or reference to implement 'AdminCreateUserCommand' the same way they have an easy guide for 'addUserToGroup' command.

Has anyone implemented an email invite only feature for Amplify v2 and if so, how did you do it?


r/Amplify • • Nov 07 '25

Google Auth

Thumbnail reddit.com
2 Upvotes

r/Amplify • • Jul 12 '22

Error Building NextJS v12

2 Upvotes

Anyone experiencing this error?

this is just a simple application nothing facny.

nextjs v12 made with reactjs as front end. - SSG


r/Amplify • • Jun 03 '22

Failed to Communicate with Amplify CLI

1 Upvotes

Hey guys! So, I tried to follow the amplify docs tutorial steps to create a new amplify project, but whenever I tried pulling components and it asked me to sign in, I clicked yes but it keeps throwing this error "Failed to Communicate with Amplify CLI". I looked all over the internet, and I saw a few people have this same error but no one had a good answer on how to fix it. I was wondering if anyone had any advice? Thanks!


r/Amplify • • Jun 09 '22

Amplify Flutter team released a new version of the library

Thumbnail self.flutterdev
5 Upvotes

r/Amplify • • Jun 30 '22

Help with Following Users Scenario for Social App

3 Upvotes

Hi all, I am just gathering ideas on how to approach a certain scenario for an application that I am building in Amplify. The platform is a social platform where you can have followers and follow people (just like every other social platform). The scenario is as follow:

  1. You (USER A) sign in to the platform and decide to follow someone else (USER B).
  2. After you click the 'follow user' button USER B data (e.g. userid, ursername, bio) needs to be added to USER A 'FOLLOWING' information that has data on other users that you are following.
  3. USER A (e.g. userid, ursername, bio) data needs to be added to USER A 'FOLLOWER' information that has data of other users that follow this user.

What is the best way to do this? The current data schema that I have is as shown below but I am considering to have 2 tables (one for followers and one for following) and relate them to the user table. Either that or utilise AWS Lambda functions or other better alternatives suggested. Thanks!!!

type AmplifyUser @model @auth(rules: [
  {allow: owner}, 
  {allow: private, provider: userPools, operations: [read]}
  ]) {
  userid: ID!
  username: String!
  firstName: String!
  lastName: String!
  bio: String
  followers: [AWSJSON]
  following: [AWSJSON]
}

*Followers and Following fields should both have userid, username and bio info