e-Spirit / javascript-content-api-library

Apache License 2.0
7 stars 11 forks source link

fetchElement error: The filter query requires a value #211

Open LarsOlt opened 3 months ago

LarsOlt commented 3 months ago
await fsxaApi .fetchElement({
    id: reference.referenceId,
    locale: tabSection.previewId.split('.')[1], // e.g. 8e805568-5301-43df-868b-7e952f40ba8a.de_DE
})

We are using this code to resolve a page reference, which works fine. The console is showing the following error from the fsxa-api package though:

"Error: The filter query requires a value"

How can we fix this? There is no filter option on the function.

image
nico-mcalley commented 3 months ago

Hey Lars, I was not able to reproduce your described behaviour. Internally the fetchElement method calls a fetchByFilter with following filter:

{ field: 'identifier', operator: ComparisonQueryOperatorEnum.EQUALS, value: id, }

As you can see here, this error is only thrown, when there is a problem with the provided id.

Could you provide a minimal reproduction to the problem?