Skip to content

feature/doc/question: #1196

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

Open
xenoterracide opened this issue Aug 19, 2022 · 0 comments
Open

feature/doc/question: #1196

xenoterracide opened this issue Aug 19, 2022 · 0 comments
Labels
enhancement New feature or request stale

Comments

@xenoterracide
Copy link

Ok, I'm not actually certain if this isn't something possible, but I don't see it in the docs

Describe the Feature Request

https://netflix.github.io/dgs/data-loaders/#using-the-dgsdatafetchingenvironment

Why can't/shouldn't I do something like this instead? by the way, I notice a lot of things show CompletableStage being returned by the DataLoader but this says CompletableFuture, so which should it be?

@DgsComponent
public class UsersDatafetcher {

  private final UsersLoader loader;

  UsersDatafetcher(UsersLoader loader) {
    this.loader = loader;
  }

  @DgsQuery
  public CompletableFuture<List<User>> users( @InputArgument List<String> keys ) {
    return loader.load(keys)
  }
}

Describe Preferred Solution

Ideally the documentation should show this option, if it doesn't work then it'd be a nice feature. If it's a bad idea, I'd love to know why.

Describe Alternatives

@xenoterracide xenoterracide added the enhancement New feature or request label Aug 19, 2022
@github-actions github-actions bot added the stale label Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

1 participant