'SharePoint picker API folder name return

I am currently implementing a folder picker in our app. The picker uses the OneDrive & SharePoint Javascript picker. https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/open-file?view=odsp-graph-online

Everything is looking good, I can set a root folder etc and get a response. Unfortunately, the response only has the Id of the folder and not the name.

enter image description here

I have tried to use the queryParameters prop to select id, name etc using select=id,name but that does not help at all.

Here is the configuration that is sent to the picker.

         this.options = {
            clientId: '<ClientID>',
            accountSwitchEnabled: false,
            action: "query",
            multiSelect: true,
            viewType: OneDriveViewType.All,
            advanced: {
                endpointHint: '<SharePoint Link>/Shared%20Documents',
            },
            success: (folder) => this._onSuccess(folder),
            cancel: () => this._onCancel(),
            error: (error) => this._onError(error)
        }

        // Show the picker
        OneDrive.open(this.options);

Is there an option that I am missing? As per the docs, the response should contain the "name" property, although it show it for a folder. https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/open-file?view=odsp-graph-online#4-handling-the-picker-response-object



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source