You need to use a feature service. If you have the editor widget enabled in your application an dyou don't want to have some layers editable, you can go into the service properties and turn on editing but leave query turned on.
The problem I have foudn is that this causes each layer you list as a feature layer to be listed in the map switcher. So I published the service twice. Once just as a mapserver and once with both map and feature enabled. The second service has all the symbology set to no color and is excluded from the map switcher widget.
This is not a very elegant solution, but this particular configuration only has a handful of layers, so this solution may not work for you.