aws / aws/aws-appsync-community

Is there a way to update bidirectional connections automatically when a new object is created?

Open
#159 0 comments 7 reactions 0 assignees View on GitHub
question
Dominant language
HTML
Stars
507
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Is there any way to establish an automatic bidirectional connection so that, for instance, `CreateProfilePicture(url: ..., profilePictureUserId: ... )`, not only automatically creates a new `ProfilePicture` (works today), but also updates the connected `User { profilePicture }` field (does not happen today)?

See https://github.com/aws-amplify/amplify-cli/issues/556#issuecomment-829159925.

> This is a traditional example, where each `ProfilePicture` belongs to one `User` and each `User` has one `ProfilePicture`.
>
> ```graphql
> type ProfilePicture @model {
> user: User! @connection
> }
>
> type User @model {
> profilePicture: ProfilePicture @connection
> }
> ```
>
> We want to use `CreateProfilePicture` and, supplying only the user ID and necessary data, and create *both* the `ProfilePicture { user: { ... } }` *and* update `User { profilePicture: { ... } }`. At present, only the former happens.
>
> How can we establish a bidirectional connection like this in AppSync?

Contributor guide

Open the contributing guide

Research direction

Start with the linked Amplify CLI issue and the GraphQL schema example in this report. Investigate whether AppSync supports automatically maintaining both sides of this connection when creating a ProfilePicture, and document the supported configuration or confirmed limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.