Open Jupdi opened 1 year ago
I could fix the problem by manually add the SortableFields Enum to my schema and add the missing fields, but now i need to manually keep that in sync.
Hi @Jupdi, Thank you for bringing this to our attention.We greatly appreciate your proactive approach in resolving the problem by manually adding the missing fields to the SortableFields enum in the schema. We have successfully reproduced the problem by following the steps outlined in the description. As a result, we have categorized this as a bug and will further investigate it with our team.
schema used:
type Post @model @searchable {
postId: ID!
@primaryKey(sortKeyFields: ["title"])
@index(name: "postByPostId", sortKeyFields: ["title"])
title: String!
comments: [Comment] @hasMany(indexName: "byPost", fields: ["postId", "title"])
posttype: PostType
}
type Comment @model {
commentId: ID! @primaryKey(sortKeyFields: ["content"])
content: String!
postId: ID @index(name: "byPost", sortKeyFields: ["postTitle"]) # customized foreign key for parent primary key
postTitle: String # customized foreign key for parent sort key
post: Post @belongsTo(fields: ["postId", "postTitle"])
}
enum PostType {
newsletter
blog
}
Any update? Surprised that we can't sort by enums...
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
11.0.4
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
None
Describe the bug
I cannot use enums to sort my search results using graphql, and they are not beeing generated in to he SortableFields.
Expected behavior
Use enums to sort, like using other types of fields.
Reproduction steps
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm: