Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type inference of entity using EntityItem<typeof MyEntity> not resolving alias #719

Open
Sivarajack opened this issue Apr 20, 2024 · 1 comment

Comments

@Sivarajack
Copy link

while inferring type using EntityItem<typeof MyEntity> alias of attributes are not resolved.

const MyEntity = new Entity({
  name: 'Customer',

  attributes: {
    id: { partitionKey: true },
    sk: { hidden: true, sortKey: true },
    ag: { type: 'number', alias: 'age' },
    name: { type: 'string', map: 'data', alias: 'n' },
    co: { alias: 'company' },
  },

  table: MyTable,
} as const);

here age and company is aliased but while inferring type its inferred as ag and co
image

is there something I am missing? any help will be much appreciated. Thanks.

@naorpeled
Copy link
Collaborator

Hey @Sivarajack,
I took a look at this earlier today and realized that alias isn't working as I remembered it did. It seems to be an issue on the lib's end.

I'll try to take another look asap. But unfortunately that won't be today 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants