Hey, everybody.
I want to get the value like [[1,2,3], [1,2,3]].
What should I do?
@Field(() => [[Int]])
key?: number[][];
It's not work!
It will report:
Cannot determine GraphQL output type for key
any advice is welcome.
Thank you!!!!
Closing for a housekeeping purposes 馃敀
@19majkel94 I have the same problem, I can not find a solution, how to do it?
@Field(() => [[Int]])
configurationStart: number[][];
@Field(() => [[Int]])
configurationEnd: number[][];
Error: Cannot determine GraphQL output type for configurationStart
I really need it to be an array
Thank you :)
@Almesia It's not possible even in GraphQL spec:
https://github.com/graphql/graphql-spec/issues/423
@Almesia
hey man, my solution may be ugly, but it works.
import { GraphQLScalarType } from 'graphql';
export const NumberArrayScalar = new GraphQLScalarType({
name: 'NumberArray',
description: '',
parseValue(value: number[]) {
return value || [];
},
serialize(value: number[]) {
return value || [];
},
parseLiteral(ast) {
return ast || [];
},
});
FYI 馃榿
Thank you 馃槃 That's all what i wanted
It actually is possible in the spec.
The example in that issue is with tuples in a list (ie. [[Int, Float]]) which is not allowed, but the spec does allow things such as the one here : [[Int]]. You can try it with the reference implementation and it should work.
I was able to generate something like this as an example:

@TDiazT
You are right 馃槈
It can be even N dimension array of the T type - I've checked the [[[Int!]!]!]!.