Skip to content

Sync Expressions in DataStore in Amplify@5 with old API's break the sync #10785

@svidgen

Description

@svidgen

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

DataStore

Amplify Categories

api

Environment information

# Put output below this line


Describe the bug

I'm not sure what version/flags of the CLI is necessary to create this scenario. But, I have an "old" sample app wherein the FK fields from some connected models are not available for in the GQL sync query selection set.

I have a Blog model where I can provide a blogOwnerId at mutation time:

image

However, blogOwnerId is not available in the selection set.

image

When I add a syncExpression on Blog, blogOwnerId is included to the selection set on sync, and the sync therefore fails.

Expected behavior

DataStore should only include these connection/FK fields in the selection set if they're explicitly defined.

Reproduction steps

🤷

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

DataStoreRelated to DataStore categorybugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions