You are trying to get the graphics too soon. The graphics are not loaded in AGSFeatureLayer.graphics when layer is created. When layer is created and added to map, layer send a query to server to fetch the features. And after that you should try to get the graphics from feature layer.