trompamusic / ce-api

The Contributor Environment API for the TROMPA project
https://trompamusic.eu
Apache License 2.0
6 stars 1 forks source link

json-ld: Don't render fields in the output if they're not in the json mapping file #181

Closed alastair closed 3 years ago

alastair commented 3 years ago

In some types we've added specific relations in order to generate filter queries for them: https://github.com/trompamusic/ce-api/blob/24270a1f4d65bd3cc34a12b8dca0b9372454b34a/src/schema/type/MusicComposition.graphql#L176-L179 These fields are useful only for graphql, and shouldn't be rendered in the jsonld.

A good way to do this would be to remove these fields from the matching json file that contains the field->type mappings. If a field doesn't exist in this file it shouldn't be rendered

Extension: Don't render items if their value is empty (null or empty array)

alastair commented 3 years ago

This functionality already exists, these fields were present in MusicComposition.json. I removed them and they're no longer in the output.