Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public DataFetcher setDriverDataFetcher() {
return dataFetchingEnvironment -> {
String carId = dataFetchingEnvironment.getArgument("id");
String firstName = dataFetchingEnvironment.getArgument("firstName");
String lastName = dataFetchingEnvironment.getArgument("lastName");
Map<String, String> driverDetails = new HashMap<>();
driverDetails.put("firstName", firstName);
driverDetails.put("lastName", lastName);
driverDetails.put("id", carId);
drivers.add(driverDetails);
return driverDetails;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.