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

Feature Request: Amplify Gen2 SelectionSet Support for CustomQueries

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 - Amplify Gen 2

Describe the feature you'd like to request

Right now there is no way to define the selection set that you want in your custom queries using amplify gen 2.

Refer to this thread with @chrisbonifacio: https://github.com/aws-amplify/amplify-js/issues/13365

Describe the solution you'd like

I would like to be able to define selection sets (e.g. deeper hasMany relationship objects) in custom queries.

Describe alternatives you've considered

Right now I have to enter:

npx ampx generate graphql-client-code --out src/graphql

to generate graphQL code and define the deper objects in the output:

query CheckBatchOfPhoneNumbersForActiveUsers($phoneNumbers: [String]) {
  checkBatchOfPhoneNumbersForActiveUsers(phoneNumbers: $phoneNumbers) {
    createdAt
    phoneNumber
    updatedAt
    user {
      birthdate
      createdAt
      firstName
      id
      lastName
      profileImage
      profileImageBlurhash
      pushToken
      searchTerm
      updatedAt
      username
      __typename
    }
    userId
    __typename
  }
}

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 May 18 '24 22:05 ChristopherGabba