ModelQueriesFactory.get only uses ID, impossible to fetch the entity with a pair of hashKey & rangeKey #1710
Closed
1 of 9 tasks
Labels
duplicate
This issue or pull request already exists
feature-request
A request for a new feature or an enhancement to an existing API or category.
GraphQL API
Issues related to the API (GraphQL) Category
Description
Hello,
I have the following model:
hashKey: Int! @primaryKey(sortKeyFields: ["rangeKey"])
I want to fetch one entity from this model so I went for:
ModelQueries.get only accepts an ID and I have entities sharing hashKeys. (reponse.data is not a list, not sure what happens if I use one of the hashKey as ID, I didn't try.)
Also, ModelQueries.get's ID is expecting a string whereas here my hashKey is an int.
The generated model contains both keys:
getParty(hashKey: Int!, rangeKey: String!)...
I should be able to bypass this by creating my own query but wanted to check with you before.
Thanks!
Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
N/A
OS
N/A
CLI Version
8.4.0
Additional Context
No response
The text was updated successfully, but these errors were encountered: