There is a way, although that way uses unofficial API and may not work in any release but the current one (3.9.2 as of writing).
In the GraphML add the following key on the graph level:
<g:key id="ppkey" for="graph" yfiles.type="postprocessors"/>
<g:graph id="G" edgedefault="directed">
<g:data key="ppkey">
<y:Postprocessors>
<y:Processor class="A.A.A.A.A">
<y:Option name="IGNORE_WIDTHS" value="false"/>
<y:Option name="IGNORE_HEIGHTS" value="true"/>
<y:Option name="ADAPT_TO_MAXIMUM_NODE" value="false"/>
</y:Processor>
</y:Postprocessors>
</g:data>
</g:graph>
As you can see "A.A.A.A.A" obviously is an obfuscated class name and that may change between builds and in a way break your script.
The reason for this inconvenience is actually quite simple: yEd is not supposed to be used in an automated way (the license even explicitly forbids the purely automatic use case) and thus is optimized for interactive use. So clicking on the button is in fact intended. Why? Because yEd is a free product based on a powerful commercial library and it is only free because power users buy a license for the library and thus in a way sponsor yEd's development and support. If you really need to programmatically leverage that power you should take a look at licensing the library directly.
That said, you could also try the Excel import - it will automatically perform this step for you, however you will have to create an excel file to start from.