enonic / lib-guillotine

Apache License 2.0
3 stars 0 forks source link

Attachment input types resolves to [Content], but should return string (i.e. attachment handle) #54

Closed sigdestad closed 4 years ago

sigdestad commented 4 years ago

Attempting to get the value of an attachment field gives the following error:

{ "errors": [ { "errorType": "ValidationError", "message": "Validation error of type SubSelectionRequired: Sub selection required for type Content of field attachment1 @ 'guillotine/query/data/attachment1'", "locations": [ { "line": 7, "column": 11 } ], "validationErrorType": "SubSelectionRequired" } ] }

Suggested solution:

sigdestad commented 4 years ago

An alterative (and better solution) would be if an "attachment" field returns the "referenced" attachment object. Same as you get when going directly to {contentx{attachment{x}}}

NB! Technically, the referenced attachment might be missing (so must also be handled gracefully)

sigdestad commented 4 years ago

Hi T. Please implement by returning the atrachment type, not string :)