-
Notifications
You must be signed in to change notification settings - Fork 79
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
Is it possibile to change the filter of @searchable autogenerated query? #333
Comments
@mdepascale |
hello @ammarkarachi
into this
notice the ! after SearchableDocumentFilterInput I've already have get in contact with the aws support and they told me it can't be done. |
I have kind of similar related problem: type Factory
@model
@searchable
@key(fields: ["pk", "sk"])
) {
pk: ID!
sk: ID!
dataType: DataType! ---------> enum type
######################################
workstation: WorkStationData #input types nested objects {contains multiple fields}
region: RegionData #input type nested object
} I used searchable directive and the filtering code generated by Tranformer doesn't include workstation object. export type SearchableFactoryFilterInput = {
pk?: SearchableIDFilterInput | null,
sk?: SearchableIDFilterInput | null,
and?: Array< SearchableFactoryFilterInput | null > | null,
or?: Array< SearchableFactoryFilterInput | null > | null,
not?: SearchableFactoryFilterInput | null,
}; It only contains pk and sk so I do not have choice to get data based on nested filtering. Any suggestion? |
Hello @mdepascale |
Hello @vkumarvs Enums: aws-amplify/amplify-cli#3248 |
@SwaySway could you expand with an example on how to add the query manually in the schema? How would you disable the default query generated by amplify? For example assume the following schema: interface ChatMessage {
id: ID!
userId: ID!
user: User
text: String!
deleted: Boolean
createdAt: AWSDateTime!
} I'd like the search to only return messages where Same for a different model where there is a If the filter is not mandatory, you can just pull the entire database by omitting it. |
Why is this not possible? We have a use case where we are applying a custom pipeline resolver to the ElasticSearch data source in Amplify to use complex security. If we want to use the resources generated by Why can we not use It also appears we cannot replace the |
Which Category is your question related to?
Amplify auto generated query @model @searchable
Amplify CLI Version
4.16.1
What AWS Services are you utilizing?
Amplify, DynamoDB, ElasticSearch, Cognito
Provide additional details e.g. code snippets
searchDocuments(filter: SearchableDocumentFilterInput, sort: SearchableDocumentSortInput, limit: Int, nextToken: String): SearchableDocumentConnection
.is it possible to make the filter required? like this
filter: SearchableDocumentFilterInput!
also is it possibile to not have the autogenerated query? maybe doing @searchable(null) ?
thank you
The text was updated successfully, but these errors were encountered: