Sharing an array between Convex and UI?
As an example, I have a table of contacts. One of the fields in this table is
currentState. In the current iteration of our data (Airtable), this field has 23 different options. Rather than keep multiple copies of that list, I'd prefer to just maintain one.One idea that came to mind was to do the following:
* Create the array of options in one of my Convex files
* Transform that into a validator for use in the schema and appropriate query/mutation functions (using the
literals() helper function)* Make a Convex query function that returns the array, to be used in my UI code via
useQuery()The first two are the no-brainers. The last item, though, I'm not sure about. Is it bad form to make a query that doesn't actually query the database? Is there a better way to go about this?
