While trying to build a custom component for Prisma Admin, it became apparent that it's difficult to handle the data without any field/type level meta information.
Currently it's only possible to use a field names to refer to data, which ties custom views only to specific types and makes them very brittle to changes in the datamodel.
This means we should provide some additional information on the types and/or fields, which would help to build more generic components that render Text fields, Enum fields etc in a specific way, regardless of the field name.
An initial proposal by @Huvik is to add an additional url param (/url?data=JSON.stringify(data)&fields=JSON.stringify(fields)) with the following field level info:
While trying to build a custom component for Prisma Admin, it became apparent that it's difficult to handle the data without any field/type level meta information.
Currently it's only possible to use a field names to refer to data, which ties custom views only to specific types and makes them very brittle to changes in the datamodel.
This means we should provide some additional information on the types and/or fields, which would help to build more generic components that render Text fields, Enum fields etc in a specific way, regardless of the field name.
An initial proposal by @Huvik is to add an additional url param (
/url?data=JSON.stringify(data)&fields=JSON.stringify(fields)
) with the following field level info:This would be a great moment to discuss what additional information would be needed to build flexible custom UI components for data of any shape.