fibery.getEntityById - If fields are not passed, all 1st level fields will be returned?

I might be missing something but how does one get all 1st level fields via fibery.getEntityById?

When I try something like this:

await fibery.getEntityById(entity.type, entity.id, [])

I only get something like this:

{ Id: '913ab0a0-a17e-11ac-abcd-645c978db1234' }

Hello.
Yeah, description of this function is not true, I’ve fixed that.

Here is a sample of code that does what you need. You can filter some fields by some criteria.

const schema = await fibery.getSchema();
const fields = schema.typeObjectsByName[entity.type].fieldObjects.map(fieldObject => fieldObject.title);
const entityWithExtraFields = await fibery.getEntityById(entity.type, entity.id, fields);
2 Likes