Join Slack
Powered by
can we store multidimensional arrays in graphcool?...
# prisma-whats-new
a
Akshay
03/15/2018, 9:47 AM
can we store multidimensional arrays in graphcool? like square[][]
n
nilan
03/15/2018, 10:29 AM
Yes, but not "natively", because that's not a valid GraphQL type. But you can easily use types and relations to emulate it.
a
Akshay
03/15/2018, 10:32 AM
Hey thanks! can you give an example. i didn’t get how to emulate it
n
nilan
03/15/2018, 10:37 AM
well, for example one type would be called Row, that has a scalar list. Then in another type you can have a list of rows.
a
Akshay
03/15/2018, 10:41 AM
type Number { number: Int } type Row { row: [Number] } type listRow { double_row: [Row] }
n
nilan
03/15/2018, 10:44 AM
you can drop the Number type and write row: [Int!]! instead
a
Akshay
03/15/2018, 10:46 AM
yes that makes sense. thanks nilan😀
Open in Slack
Previous
Next