Created
September 1, 2017 06:29
-
-
Save bbakerman/2d7297a31effc60586ab6bd68d9cf9c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DataFetcher userDataFetcher = new DataFetcher() { | |
@Override | |
public Object get(DataFetchingEnvironment environment) { | |
CompletableFuture<User> userPromise = CompletableFuture.supplyAsync( | |
() -> { | |
return fetchUserFromDatabase(environment.getArgument("userId")); | |
}); | |
return userPromise; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment