Skip to content

Feature Request: Amplify Gen2 SelectionSet Support for CustomQueriesΒ #457

@ChristopherGabba

Description

@ChristopherGabba

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:
aws-amplify/amplify-js#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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions