This plugin overrides the default GraphQL types generated by the gatsby-source-kontent
plugin.
-
projectId
: the Kentico project id used by thegatsby-source-kontent
plugin -
managementKey
: The Management API key of the Kentico project -
typesToGenerate
: optional array listing the types that needs to be generated. if the array is empty, nothing will be handled by this plugin. If omitted, it will override all types
- If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required
- If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required
- If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required
- If the
Limit number of assets
constraint is configured in Kentico Kontent:- The element will return a single value if the limit is either
at most 1
orexactly 1
- For whatever other value, the element will return an array
- The element will return a single value if the limit is either
- If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required
- If the
Show in content item as
constraint is configured as "Radio buttons" in Kentico Kontent, The element will return a single value. Otherwhise it will be returned as an array. - Every choice configured in Kentico Kontent will be transformed into a
enum
type in GraphQL, as to provide correct type-hinting in Typescript
- If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required
- If the
Limit number of assets
constraint is configured in Kentico Kontent:- The element will return a single value if the limit is either
at most 1
orexactly 1
- For whatever other value, the element will return an array
- The element will return a single value if the limit is either
- Every
Allowed content type
configured in Kentico Kontent will be transformed into aunion
type in GraphQL, as to provide correct type-hinting in Typescript