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

Return value of Store.query is incorrect #1446

Open
1 task done
lolmaus opened this issue Sep 3, 2021 · 1 comment
Open
1 task done

Return value of Store.query is incorrect #1446

lolmaus opened this issue Sep 3, 2021 · 1 comment
Labels
types:core:data Something is wrong with the Ember Data type definitions types:core Something is wrong with the Ember type definitions

Comments

@lolmaus
Copy link

lolmaus commented Sep 3, 2021

Which package(s) does this problem pertain to?

  • @types/ember-data

Reproduction Case

const result = await store.query('products');

Now about that bug. What did you expect to see?

result.meta // => a `Record` with metadata

What happened instead?

TypeScript says that property meta does not exist.

Comment

meta exists exists in type ManyArray and, by inherence, PromiseManyArray.

But Store.query is typed to return PromiseArray that does not contain meta.

CC @chriskrycho @dfreeman @jamescdavis @mike-north @dwickern @catz

Issue migrated from DefinitelyTyped/DefinitelyTyped#55562

@chriskrycho
Copy link
Member

Thanks for opening this! @jamescdavis I believe you know Ember Data best of the current maintainers (and cc. also @runspired) – the docs say we ought to return a Promise of an AdapterPopulatedRecordArray at this point (which type simply did not exist when the current types were written!), and that does not have meta on it. What’s the right answer?

@chriskrycho chriskrycho added the types:core Something is wrong with the Ember type definitions label Oct 26, 2021
@chriskrycho chriskrycho added the types:core:data Something is wrong with the Ember Data type definitions label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types:core:data Something is wrong with the Ember Data type definitions types:core Something is wrong with the Ember type definitions
Projects
None yet
Development

No branches or pull requests

2 participants