kotlin.collections.List are automatically mapped to the GraphQL
List type (for unsupported
use cases see below). Type arguments provided to Kotlin collections are used as the type arguments in the GraphQL
type. Kotlin specialized classes (e.g.
IntArray) representing arrays of Java primitive types without boxing overhead
are also supported.
The above Kotlin class would produce the following GraphQL schema:
graphql-kotlin-schema-generator supports the following primitive array types without autoboxing overhead. Similarly to
kotlin.Array of objects the underlying type is automatically mapped to GraphQL
The underlying GraphQL types of primitive arrays will be corresponding to the built-in scalar types or extended scalar types provided by
Currently, the GraphQL spec only supports
Lists. Therefore, even though Java and Kotlin support number of other collection
graphql-kotlin-schema-generator only explicitly supports
Lists and primitive arrays. Other collection types
Sets (see #201) and arbitrary
structures are not supported out of the box. While we do not reccomend using
Set in the schema,
they are supported with the use of the schema hooks.
See Discussion #1110 for more details.