-
Notifications
You must be signed in to change notification settings - Fork 222
Description
Is your feature request related to a problem? Please describe.
I am trying to create a query that lists just the owner
s of each item in a schema, like this:
let request = GraphQLRequest<MyModel>.list(MyModel.self)
I was trying to find a way to only include the owner
using includes
, like this
let request = GraphQLRequest<MyModel>.list(MyModel.self, includes: { myModel -> myModel.owner })
but from the documentation and type errors, includes is just to include relations and not attributes.
Being able to query by fields is important because some fields may not be readable by all users. The only way to make a list query in this case would be to only query fields that the user does have access to.
Describe the solution you'd like
I'd like something like GraphQLRequest<MyModel>.list(MyModel.self, attributes: [my_list_of_attributes])
, or more realistically attributes: ModelPath -> [FieldPath]
.
Describe alternatives you've considered
I am guessing this is technically possible by using a lower level function using ModelBasedGraphQLDocumentBuilder
. If that is the solution you recommend, could you provide some documentation for it?
Is the feature request related to any of the existing Amplify categories?
No response
Additional context
No response