Hello,
I have an own GraphQL API, that I intend to use for 2 step configuration process: on the first page, user can create a JSON Schema and submit it to an API, on the next page - Retool should use the provided schema to generate the JSON Schema form.
Generally, that idea would work fine, unless I would like to include the data from another query to make the dropdown. To achieve that purpose, I generate the schema that looks like that:
"retoolSchema": "{\n \"title\": \"Example\",\n \"type\": \"object\",\n \"properties\": {\n \"building\": {\n \"$ref\": \"#/definitions/buildings\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"definitions\": {\n \"buildings\": {\n \"type\": \"number\",\n \"enum\": {{buildingsQuery.data.buildings.map(x => x.id)}},\n \"enumNames\": {{buildingsQuery.data.buildings.map(x => x.name)}}\n }\n }\n}",
I expected that string to be evaluatable to the valid JSON schema format, but query data doesn't get evaluated. If I copy the value and paste it - evaluation happens.
Is there a way to evaluate the string in a runtime? Or maybe there are some better approaches to that problem?