Socket
Socket
Sign inDemoInstall

@sonarsource/marketing-gatsby-transformer-kontent-graphql

Package Overview
Dependencies
Maintainers
18
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sonarsource/marketing-gatsby-transformer-kontent-graphql

Custom GraphQL types for @kentico/gatsby-source-kontent


Version published
Weekly downloads
96
decreased by-22.58%
Maintainers
18
Weekly downloads
 
Created
Source

Gatsby Transformer Kontent GraphQL

This plugin overrides the default GraphQL types generated by the gatsby-source-kontent plugin.

Configuration

  • projectId: the Kentico project id used by the gatsby-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

Changes brought to the default gatsby-source-kontent GraphQL types

Text element

  • If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required

URL Slug element

  • If the element is marked as required in Kentico Kontent, the GraphQL type will also be marked as required

Asset element

  • 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 or exactly 1
    • For whatever other value, the element will return an array

Multiple choice element

  • 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

Linked Item and Subpages element

  • 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 or exactly 1
    • For whatever other value, the element will return an array
  • Every Allowed content type configured in Kentico Kontent will be transformed into a union type in GraphQL, as to provide correct type-hinting in Typescript

Keywords

FAQs

Package last updated on 16 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc