There's no way to create a gradient filled outline in one operation, you have to create the outline and then set its fill to gradient.
Create the object, create the outline. Select the outline and on the Fill/Stroke Editor dialog select 'Gradient Fill'. The gradient will only be applied to the outline and not to the object.