clentfort / urql-custom-scalars-exchange

MIT License
36 stars 20 forks source link

Fix nested arrays handling #25

Open OzTK opened 1 year ago

OzTK commented 1 year ago

Use-case

One may return multidimensional arrays from a query, such as:

myQuery(): [[String!]!]!

This is especially useful for data that gets graphed in a dashboard.

Current behaviour

The first level of array gets properly forwarded to the client, but the second level gets converted to an object: [['a'], ['b'], ['c']] -> [{0: 'a'}, {0: 'b'}, {0: 'c'}]

Desired behaviour

Any level of nesting of arrays should be forwarded as is