-
Notifications
You must be signed in to change notification settings - Fork 247
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 - Nested types are not supported #260
Comments
To expound upon a major aspect of the issue here, I'm not seeing NestedType have a class generated for it. While the NestedType is not defined as a @model, it does cause a NestedType.dart file to be generated in lib/models. However this is the entirety of the generated file:
Not even a constructor is generated. This class seems to be correctly referenced in the generated TestModel.dart, though the class is imported in neither TestModel.dart nor ModelProvider.dart (the latter of which may be correct as NestedType is not a @model). I'm a bit confused how the OP got to an AppSync response error in this case, as the code generation issues I describe lead to compile errors. Perhaps my issue isn't quite the same, but does seem to be related to custom nested types. Additionally I think it's fair to tag this more strongly than a feature request, as I seem to be generating code that doesn't compile from a successful run of |
There are a bunch of problems with the Amplify CLI when generating Flutter models so to produce the Furthermore, I found that it doesn't look like the Android For reference: Agree that this should be marked with a little more urgency than a feature request. Flutter DataStore support at this point is pretty much useless for anything other than trivial @model schemas due to various problems with CLI codegen, Android, and Flutter SDKs. I'm hoping the DataStore feature gets a revisit and some much needed ❤️ soon. |
I too have this same issue when trying to use codegen and using the S3Object example with graphql schema |
I would like to request that this issue be turned into a bug instead of a feature request in hopes of elevating its priority. Nested types are supported on all other platforms and without this support I am still resorting to using my own custom DataStore plugin for Flutter (described here) I created back in September. Do you know of any workarounds or hacks that would let me switch to the official DataStore Flutter SDK plugin when the backend GraphQL schema is already in use by other platforms? I thought I might be able to just switch the local schema to use AWSJSON as the field type, generate the Flutter models, and then deserialize these nested types myself. However, that doesn't work because the backend AppSync requests/sync/subscriptions are expecting a specific format and I get the |
Hi guys thank you all for explaining the issue encountered. @kjones we will mark this as a bug as well and investigate this more on our side. |
I got the same problem now. Awesome!!! type S3Object { type DocumentPicture @model (...) { It only generates the licence header and import 2 .dart archives. Thats it for S3Object. Is there is a workaround? Im in latest version -> 4.48.0. |
Running into the same issue. Are there any updates on the investigation/fix? |
I am also facing the same issue, any updates on this? |
I'm unable to create and use any 1:n relationship, which is a very basic use case, can someone please tell me if there is a workaround |
Hi @ChaitanyaVootla sorry for missing your comment above. I wanted to follow up with the use case you mentioned.
What are you actually referring to by 1:n relationship? e.g. 1:n (hasMany relationship) this is supported by amplify-flutter DataStore today. type Post @model {
id: ID!
title: String!
comments: [Comment] @connection(keyName: "byPost", fields: ["id"])
}
type Comment @model
@key(name: "byPost", fields: ["postID", "content"]) {
id: ID!
postID: ID!
content: String!
} Or are you referring to collection of a type Album @model {
id: ID!
name: String!
pictures: [S3Object]
}
type S3Object {
bucket: String!
region: String!
key: String!
} |
Hi all, amplify-flutter This preview release requires a corresponding preview release of |
@kjones @raywhiteside Were you able to give the preview release a try? |
I have not, sorry. |
I have not had a chance to try this either and probably won't be able to get to this for a few weeks. |
Done a bit of preliminary testing with |
CustomType is now supported with version 0.3.0. Thanks everyone. |
An example would be the following:
This schema currently results in a
SubSelectionRequired
response error from AppSync when establishing subscriptions.The text was updated successfully, but these errors were encountered: