Data and Content: blank screen when model has custom key which is not ID
Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the FAQ.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
App Id
No response
Region
No response
Amplify Console feature
No response
Describe the bug
admin/{appid}/{env}/datastore cannot be opened (blank screen) when model has custom key which is not ID:
455.fd53f4c6.chunk.js:2 TypeError: Cannot read property 'value' of undefined
at Ke (main.2ea88a27.chunk.js:1)
at main.2ea88a27.chunk.js:1
at Array.map (<anonymous>)
at main.2ea88a27.chunk.js:1
at Array.map (<anonymous>)
at a.value (main.2ea88a27.chunk.js:1)
at Uo (455.fd53f4c6.chunk.js:2)
at qo (455.fd53f4c6.chunk.js:2)
at hs (455.fd53f4c6.chunk.js:2)
at cu (455.fd53f4c6.chunk.js:2)
Expected behavior
admin/{appid}/{env}/datastore can be opened
Reproduction steps
https://user-images.githubusercontent.com/7160998/130135378-f64328d2-cb88-4b31-9bbf-e3ddb7e47b0e.mov
https://user-images.githubusercontent.com/7160998/130135387-b43bd1ec-6401-4860-a70e-d21d557a2128.mov
Build Settings
No response
Additional information
No response
I am also getting this exact same behaviour when I have a custom id i.e. that is not named 'id'
@cslogan-red I don't think it's a feature request, it's definitely a bug
All GQL models within Admin UI are required to have an id field as primary key, we don't support the concept of non-id custom keys due to underlying limitations of DataStore itself, it's in our backlog to add support for this feature in the future.
This should be mentioned in the docs. One of the examples uses email as a private key: https://docs.amplify.aws/cli/graphql-transformer/key/#example-get-customers-by-email
So all my models are id based with the exception of using @key which I believe just makes another table where the desired field(s) become the id which is likely the same thing just mentioning as my experience with this issue
This should be mentioned in the docs. One of the examples uses email as a private key: https://docs.amplify.aws/cli/graphql-transformer/key/#example-get-customers-by-email
Well this is just for the ui version. You can still use email as primary key and work fine in your website and all that just not in the admin ui clickable interface
@24jr from what I understood, Datastore won’t work
@dn-l Oh maybe. I don't use that. But I think straight up gql calls work fine