Is there a practical way to model this type of JSON data structure in a GraphQL schema:
{
"id": 123,
"name": "My Parent Object",
"childWidgets": {
"456": {
"id": 456,
"name": "Child Widget 1"
},
"789": {
"id": 789,
"name": "Child Widget 2"
}
}
}
Specifically, I would like childWidgets to be an associative array of objects keyed by their id values. I understand that field names in GraphQL cannot begin with a digit, but then I am not encoding the id values into the schema in this instance - these are naturally not fixed values. (There may also be cases where the array keys in question are not numeric, but similarly cannot be encoded into the schema due to their variable/ephemeral nature.)
I expect this is a common question, but I've so far only found one related question on the subject. However, that one appears to be about encoding a well defined set of numeric codes into the schema, so not exactly the same.