Do we have to pass in the facilities as graphics?
I think it's not really practical to feed the task with a lot of facility data at the run time, especially when the facility data can be easily defined and queried within the map service.
I got your point.
It seems that the documentation is not in sync with the implementation i.e. , at this time, AFAIK it's not possible to use a Data Layer as facilities.
Now I am not sure whether it's the implementation or the documentation which is wrong. I'll try to find more infos and will come back to you.
For now the documentation will be updated to be in sync with the current implementation and the usage of DataLayer has been added in the stack of the possible enhancements for a future version.
Thanks for reporting that.