amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

Add SelectionSets on Mutations

Open ChristopherGabba opened this issue 1 year ago • 0 comments

Is this related to a new or existing framework?

React Native

Is this related to a new or existing API?

GraphQL API

Is this related to another service?

DynamoDB

Describe the feature you'd like to request

I would like the ability to define selectionSets for mutations as well. Currently the mutation responses return a lot of unneeded data and I'm also getting some TS errors when comparing them to other data structures because I can't define them.

Screenshot 2024-08-23 at 7 36 25 AM

Describe the solution you'd like

        const response = await client.models.Friendship.create({
          status: FriendStatus.PENDING,
          senderId: userStore.currentUser?.id!,
          receiverId: friend.id,
        },
        {
         selectionSet: friendshipSelectionSet
        })

Describe alternatives you've considered

N/A

Additional context

No response

Is this something that you'd be interested in working on?

  • [ ] 👋 I may be able to implement this feature request
  • [ ] ⚠️ This feature might incur a breaking change

ChristopherGabba avatar Aug 23 '24 12:08 ChristopherGabba