-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datastore HasOne connection never populated #1107
Comments
Experiencing this as well :( |
Summary from @diegocstn
type Team @model @auth(rules: [{ allow: owner, operations: [create, update, delete] }]) {
id: ID!
name: String!
}
type Project @model @auth(rules: [{ allow: owner, operations: [read, create, delete] }]) {
id: ID!
name: String
team: Team @connection
} Next Steps
|
This issue is stale because it has been open for 14 days with no activity. Please, provide an update or it will be automatically closed in 7 days. |
Also experienced this! The connection works with
but fails with
is this being fixed? |
Thanks for taking the time to comment. We’re working on ways to make DataStore relationships simpler. Once we get that done, we may need to adjust code in the DataStore plugin to properly handle the situation above. We’ll update this issue when we have more information. |
@palpatim @diegocstn - I think it is worth noting that the second schema creates a Probably adding to the confusion/issue is that both of these schemas are called out as examples of hasOne relations in the CLI docs. It seems like either the docs need to be updated or the ModelAssociation used should be updated. Note: the first schema being represented with Screenshot of first schema being represented with a |
Is there any update on this issue? |
Amplify have known issue which prevent to fill properties with .hasOne connection Here the issue: aws-amplify/amplify-swift#1107 And here the prepared fix: aws-amplify/amplify-swift#1676 Since fix was on github for while without any changes I switched the to the forked version of amplify
Amplify have known issue which prevent to fill properties with .hasOne connection Here the issue: aws-amplify/amplify-swift#1107 And here the prepared fix: aws-amplify/amplify-swift#1676 Since fix was on github for while without any changes I switched the to the forked version of amplify
Amplify have known issue which prevent to fill properties with .hasOne connection Here the issue: aws-amplify/amplify-swift#1107 And here the prepared fix: aws-amplify/amplify-swift#1676 Since fix was on github for while without any changes I switched the to the forked version of amplify
Amplify have known issue which prevent to fill properties with .hasOne connection Here the issue: aws-amplify/amplify-swift#1107 And here the prepared fix: aws-amplify/amplify-swift#1676 Since fix was on github for while without any changes I switched the to the forked version of amplify
Hello, For reference, I used the following schema and code snippet. I was able to fetch the
|
Describe the bug
When specifying a HasOne connection as described in the documentation (https://docs.amplify.aws/cli/graphql-transformer/connection#has-one), the linked child object is never populated when querying from AppSync.
To Reproduce
Defined as model as shown:
After codgen completed I am able to insert objects into the datastore and DynamoDB successfully. I can query the child object from the AppSync Query tool as well
However, when I query the DataStore as shown:
the child profile object is always nil. I have confirmed that even if the data is being lazy-loaded from the local store, this should still work because the NomadUser that I have blocked is in the local data store.
Expected behavior
I expect the BlockedProfile object to be populated when querying the datastore.
Environment(please complete the following information):
Amplify Framework 1.6.1
Dependency Manager Cocoapods
Swift 5.0
Amplify version 4.45.2
Device Information (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: