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

[QUESTION] name is now required in options? #332

Closed
mdecurtins opened this issue Feb 2, 2023 · 4 comments
Closed

[QUESTION] name is now required in options? #332

mdecurtins opened this issue Feb 2, 2023 · 4 comments

Comments

@mdecurtins
Copy link

I think there may be an issue introduced by the recent PR #326. The Typescript declaration in index.d.ts is name: string | null, but shouldn't it be name?: string | null, especially if null is the default value if name is not provided in Options?

Typescript (we're using 4.8.4) is suddenly giving me a flood of TS2345 errors saying that my Dataloader instances are missing property 'name' in Options, which is a correct error given the way index.d.ts is written, but these are spurious errors because name is optional and I believe it should be declared as name?: string | null.

Anybody else run into this? Thanks!

@saihaj
Copy link
Member

saihaj commented Feb 2, 2023

sorry about that will be releasing a patch #331

@mdecurtins
Copy link
Author

Awesome, thanks!

@saihaj
Copy link
Member

saihaj commented Feb 2, 2023

https://github.com/graphql/dataloader/releases/tag/v2.2.1

@saihaj saihaj closed this as completed Feb 2, 2023
@ericwei0919
Copy link

ericwei0919 commented Jul 10, 2023

In release v2.2.2, the DataLoader added below attribute, should this attribute be optional? If this is required one, it would break createDataLoader method of @lifeomic/dynamodb-dataloader which worked with v2.2.1.

name String null The name given to this DataLoader instance. Useful for APM tools.

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

No branches or pull requests

3 participants