Frequently Asked Questions

Product Information & Management SDK Usage

What is the Hygraph Management SDK and what can I do with it?

The Hygraph Management SDK is a toolkit that allows users to programmatically create, update, and delete models, fields, components, enumerations, locales, stages, apps, and remote sources within their Hygraph project. It provides granular control over your content schema and supports advanced features like conditional visibility, custom renderers, and remote field integrations. Learn more in the official documentation.

How do I create, update, or delete models and fields using the Management SDK?

You can use the Management SDK methods such as createModel, updateModel, and deleteModel for models, and createSimpleField, updateSimpleField, and deleteField for fields. Each method requires specific parameters like apiId, displayName, and optional configurations. For relational, union, component, and enumerable fields, dedicated methods are available. See detailed examples here.

What types of fields can I create with the Management SDK?

The Management SDK supports creating simple fields (string, integer, richtext, slug, etc.), relational fields (asset, relation, m-n relation), union fields, component fields, enumerable fields, and remote fields. Each field type has specific configuration options, such as validation rules, visibility, localization, and custom renderers. Explore all field types here.

How do I manage conditional visibility for fields?

You can set conditional visibility for simple, relational, enumerable, union, and component fields using the visibilityCondition property in the createXXXField and updateXXXField methods. Conditions can be based on enumeration or boolean values of other fields. Removing the condition makes the field always visible. See examples here.

Features & Capabilities

What are the key features and capabilities of Hygraph?

Hygraph offers a GraphQL-native Headless CMS with advanced features such as Smart Edge Cache for fast content delivery, content federation to integrate multiple data sources, rich text formatting, custom roles for granular access control, project backups, and robust API integrations. It supports operational efficiency, scalability, and developer productivity. Learn more about features.

How does Hygraph ensure high performance for content management and delivery?

Hygraph delivers exceptional performance through its Smart Edge Cache, high-performance endpoints, and optimized GraphQL API. These features enable fast, reliable content delivery for global audiences and high-traffic applications. Developers can further optimize API usage by following Hygraph's practical advice. Read about performance improvements.

What security and compliance certifications does Hygraph have?

Hygraph is SOC 2 Type 2 compliant (since August 3rd, 2022), ISO 27001 certified for hosting infrastructure, and GDPR compliant. It offers granular permissions, SSO integrations, audit logs, encryption at rest and in transit, regular backups, and enterprise-grade compliance features. See security details.

Technical Requirements & Implementation

How easy is it to get started with Hygraph and the Management SDK?

Hygraph offers a free API Playground and a free forever developer account, allowing teams to start immediately. The onboarding process includes introduction calls, account provisioning, business and technical kickoffs, and access to extensive documentation, webinars, and live streams. Implementation timelines vary, but some customers have launched projects within 2 months. See onboarding resources.

What support and training resources are available for Hygraph users?

Hygraph provides 24/7 support via chat, email, and phone, real-time troubleshooting through Intercom chat, a community Slack channel, extensive documentation, webinars, live streams, and how-to videos. Enterprise customers receive a dedicated Customer Success Manager and structured onboarding. Access documentation.

How does Hygraph handle maintenance, upgrades, and troubleshooting?

Hygraph is a cloud-based platform, so all deployment, updates, and infrastructure maintenance are managed by Hygraph. Upgrades are seamlessly integrated, and troubleshooting is supported by 24/7 support, Intercom chat, community Slack, and comprehensive documentation. Learn more.

Pricing & Plans

What is Hygraph's pricing model?

Hygraph offers a free forever developer account, self-service plans (e.g., Growth Plan at $299/month or $199/month billed annually), and custom enterprise pricing starting at $900/month. Plans include content entries, locales, and customizable add-ons. See pricing details.

Use Cases & Benefits

Who can benefit from using Hygraph?

Hygraph is ideal for developers, product managers, and marketing teams in industries such as ecommerce, automotive, technology, food and beverage, manufacturing, transportation, staffing, and science. It supports organizations seeking to modernize legacy tech stacks, scale content operations, and deliver global digital experiences. See industry case studies.

What business impact can customers expect from using Hygraph?

Customers have achieved measurable results such as 3x faster time-to-market (Komax), 15% increase in customer engagement (Samsung), and increased online revenue share from 15% to 70% (Stobag). Hygraph helps reduce operational costs, improve scalability, and accelerate speed-to-market. Read customer success stories.

What pain points does Hygraph solve for its customers?

Hygraph addresses operational inefficiencies (e.g., developer bottlenecks, legacy tech stack modernization), financial challenges (high maintenance costs, slow launches), and technical issues (schema evolution, integration difficulties, cache and localization problems). Solutions include a user-friendly interface, content federation, Smart Edge Cache, and robust integration capabilities. See case studies.

Can you share specific case studies or success stories of customers using Hygraph?

Yes. Komax managed over 20,000 product variations across 40+ markets via a single CMS, achieving 3x faster time-to-market. Samsung improved customer engagement by 15% with a scalable member platform. Stobag increased online revenue share from 15% to 70%. AutoWeb saw a 20% increase in website monetization. Explore more case studies.

Competition & Comparison

Why should a customer choose Hygraph over alternatives?

Hygraph stands out for its GraphQL-native architecture, Smart Edge Cache, content federation, rich text management, custom roles, and project backups. It offers speed-to-market, lower total cost of ownership, scalability, and proven business results. Customers like Samsung and Komax have achieved measurable improvements. Hygraph also provides enterprise-grade security and 24/7 support. See why customers choose Hygraph.

Help teams manage content creation and approval in a clear and structured way
Hygraph
Docs

#Management SDK field examples

#Models

#Create models

client.createModel({
apiId: '<your_api_id>',
apiIdPlural: '<your_api_id_plural>',
description: `<your_model_description>`,
displayName: '<Your model name>',
});
  • apiId: String. The model apiId.
  • apiIdPlural: String. The models plural apiId. This is used for lists.
  • description: Optional - String. Description of the model.
  • displayName: String. Display name that is used to render the model in the webapp.

#Update models

client.updateModel({
apiId: '<your_api_id>',
apiIdPlural: '<your_api_id_plural>',
description: `<your_model_description>`,
displayName: '<Your model name>',
newApiId: `<your_new_api_id>`,
});
  • apiId: String. The model apiId.
  • apiIdPlural: Optional - String. The model's plural apiId. This is used for lists.
  • description: Optional - String. Description of the model.
  • displayName: Optional - String. Display name that is used to render the model in the webapp.
  • newApiId: Optional - String. The model's new apiId.

#Delete models

client.deleteModel({
apiId: '<your_api_id>',
});
  • apiId: String. The apiId of the model you wish to delete.

#Simple fields

#Create simple fields

client.createSimpleField({
apiId: `<your_api_id>`,
description: `<your_description>`,
displayName: `<your_display_name>`,
embeddableModels: `<embeddable_models>`,
embedsEnabled: `<boolean>`,
formConfig: `<form_config_json>`,
formExtension: `<form_extension>`,
formRenderer: `<form_renderer>`,
isHidden: `<boolean>`,
isList: `<boolean>`,
isLocalized: `<boolean>`,
isRequired: `<boolean>`,
isTitle: `<boolean>`,
isUnique: `<boolean>`,
isVariantEnabled: `<boolean>`,
migrationValue: `<migration_value>`,
modelApiId: `<model_api_id>`,
parentApiId: `<parent_api_id>`,
position: `<int>`,
tableConfig: `<table_config_json>`,
tableExtension: `<table_extension>`,
tableRenderer: `<table_renderer>`,
type: SimpleFieldType,
validations: `<SimpleFieldValidationsInput>`,
visibility: `<VisibilityTypes>`,
});
  • apiId: String Your simple field apiId.
  • description: Optional - String. Simple field description.
  • displayName: String. Display name that is used to render the field in the webapp.
  • embeddableModels: Optional - String.
  • embedsEnabled: Optional - Boolean.
  • formConfig: Optional - JSON.
  • formExtension: Optional - String.
  • formRenderer: Optional - String.
  • isHidden: Optional - Boolean. Makes the field hidden if true.
  • isList: Optional - Boolean.
  • isLocalized: Optional - Boolean.
  • isRequired: Optional - Boolean. Makes the field required if true.
  • isTitle: Optional - Boolean. Makes the field a title if true.
  • isUnique: Optional - Boolean. Makes the field unique if true.
  • isVariantEnabled: Optional - Boolean. Enables the field to store values for each variant of the main content entry defined by the model.
  • migrationValue: Optional - String. Value which will go in place of null if the field is later made required.
  • modelApiId: Optional - String. Model apiId.
  • parentApiId: Optional - String. Parent apiId.
  • position: Optional - Integer.
  • tableConfig: Optional - JSON.
  • tableExtension: Optional - String.
  • tableRenderer: Optional - String.
  • type: SimpleFieldType,
  • validations: Field validations.
  • visibility: Field visibility, for example VisibilityTypes.ReadWrite.

#Update simple field

client.updateSimpleField({
apiId: `<your_api_id>`,
description: `<your_description>`,
displayName: `<your_display_name>`,
embeddableModels: `<embeddable_models>`,
embedsEnabled: `<boolean>`,
formConfig: `<form_config_json>`,
formExtension: `<form_extension>`,
formRenderer: `<form_renderer>`,
initialValue: `<initial_value>`,
isHidden: `<boolean>`,
isList: `<boolean>`,
isLocalized: `<boolean>`,
isRequired: `<boolean>`,
isTitle: `<boolean>`,
isUnique: `<boolean>`,
isVariantEnabled: `<boolean>`,
migrationValue: `<migration_value>`,
modelApiId: `<model_api_id>`,
newApiId: `<new_api_id>`,
parentApiId: `<parent_api_id>`,
position: `<int>`,
tableConfig: `<table_config_json>`,
tableExtension: `<table_extension>`,
tableRenderer: `<table_renderer>`,
validations: `<SimpleFieldValidationsInput>`,
visibility: `<VisibilityTypes>`,
});
  • apiId: String Your simple field apiId.
  • description: Optional - String. Simple field description.
  • displayName: String. Display name that is used to render the field in the webapp.
  • embeddableModels: Optional - String.
  • embedsEnabled: Optional - Boolean.
  • formConfig: Optional - JSON.
  • formExtension: Optional - String.
  • formRenderer: Optional - String.
  • initialValue: Optional - String.
  • isHidden: Optional - Boolean. Makes the field hidden if true.
  • isList: Optional - Boolean.
  • isLocalized: Optional - Boolean.
  • isRequired: Optional - Boolean. Makes the field required if true.
  • isTitle: Optional - Boolean. Makes the field a title if true.
  • isUnique: Optional - Boolean. Makes the field unique if true.
  • isVariantEnabled: Optional - Boolean. Enables the field to store values for each variant of the main content entry defined by the model.
  • migrationValue: Optional - String. Value which will go in place of null if the field is later made required.
  • modelApiId: Optional - String. Model apiId.
  • newApiId: Optional - String. New apiId.
  • parentApiId: Optional - String. Parent apiId.
  • position: Optional - Integer.
  • tableConfig: Optional - JSON.
  • tableExtension: Optional - String.
  • tableRenderer: Optional - String.
  • validations: Field validations.
  • visibility: Field visibility, for example VisibilityTypes.ReadWrite.

#Delete field

client.deleteField({
apiId: `<your_api_id>`,
modelApiId: `<model_api_id>`,
parentApiId: `<parent_api_id>`,
});
  • apiId: String. Thr apiId of the field you wish to delete.
  • modelApiId: Optional - String. The modelApiId of the field you wish to delete.
  • parentApiId: Optional - String. The parentApiId of the field you wish to delete.

#Specific examples

#Title field of type string

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.String,
apiId: '<your_title>',
displayName: '<Your Title>',
isTitle: true,
isRequired: true,
visibility: VisibilityTypes.ReadWrite,
});

#Simple field of type string

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.String,
apiId: '<your_api_id>',
displayName: '<Your Display Name>',
isRequired: true,
visibility: VisibilityTypes.ReadWrite,
});

#Slug field

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.String,
apiId: '<your_api_id>',
displayName: '<Your Display Name>',
description:
'<Enter the slug for this page, such as about, blog, or contact>',
isRequired: true,
isUnique: true,
tableRenderer: 'GCMS_SLUG',
formRenderer: 'GCMS_SLUG',
});

#Hidden integer field with custom field validation

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.Int,
apiId: '<api_id>',
displayName: '<Your Display Name>',
visibility: VisibilityTypes.Hidden,
validations: {
Int: {
range: {
max: 1000,
min: 0,
errorMessage: '<Counter has to be between 0 and 1000>',
},
},
},
});

#Required & unique string field with custom regex validation for emails

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.String,
apiId: '<email>',
displayName: '<Email>',
isRequired: true,
isUnique: true,
validations: {
String: {
matches: {
regex: '^([a-z0-9_\\.\\+-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$',
},
},
},
});

#Richtext field

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.Richtext,
apiId: '<api_id>',
displayName: '<Your Display Name>',
description:
'<Enter the content for this page. The content uses the rich-text editor, giving you a better visual representation.>',
isRequired: true,
});

#Richtext with embeds and single allowed embeddable model

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.Richtext,
apiId: '<api_id>',
displayName: '<Your Display Name>',
embedsEnabled: true,
embeddableModels: ['<model>'],
});

#List of date times

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.Datetime,
apiId: '<api_id>',
displayName: '<Your Display Name>',
isRequired: true,
isList: true,
});

#Relational fields

#Create relational field

client.createRelationalField({
apiId: '<api_id>',
description: `<your_description>`,
displayName: '<Your Display Name>',
formExtension: `<form_extension>`,
formRenderer: `<form_renderer>`,
isHidden: `<boolean>`,
isList: `<boolean>`,
isRequired: `<boolean>`,
modelApiId: `<model_api_id>`,
parentApiId: '<parent_api_id>',
reverseField: {
apiId: '<api_id>',
description: `<description>`,
displayName: '<Your Display Name>',
isHidden: `<boolean>`,
isList: `<boolean>`,
isUnidirectional: `<boolean>`,
modelApiId: '<model_api_id>',
visibility: `<visibility_types>`,
},
tableExtension: `<table_extension>`,
tableRenderer: `<table_renderer>`,
type: `<relational_field_type>`,
visibility: `<visibility_types>`,
});
  • apiId: String. Your relational field apiId.
  • description: Optional - String. Relational field description.
  • displayName: String. Display name that is used to render the relational field in the webapp.
  • formExtension: Optional - String.
  • formRenderer: Optional - String.
  • isHidden: Optional - Boolean. The relational field is hidden if true.
  • isList: Optional - Boolean.
  • isRequired: Optional - Boolean. The relational field is required if true. Only supported for RelationalFieldType.Asset.
  • modelApiId: Optional - String. Model apiId.
  • parentApiId: Optional - String. Parent apiId.
  • reverseField: Reverse relational field input.
    • apiId: String. Your reverse relational field apiId.

    • description: Optional - String. Description.

    • displayName: String. Reverse field display name.

    • isHidden: Optional - Boolean. The field is hidden if true.

    • isList: Boolean.

    • isUnidirectional: Optional - Boolean. The field is unidirectional if true.

    • modelApiId: String. Reverse field model apiId.

    • visibility: Visibility types.

  • tableExtension: Optional - String.
  • tableRenderer: Optional - String.
  • type: Relational field type. For example RelationalFieldType.Asset.
  • visibility: Optional. Visibility types.

#Update relational field

client.updateRelationalField({
apiId: '<api_id>',
description: `<your_description>`,
displayName: '<Your Display Name>',
formExtension: `<form_extension>`,
formRenderer: `<form_renderer>`,
isHidden: `<boolean>`,
isList: `<boolean>`,
isRequired: `<boolean>`,
modelApiId: `<model_api_id>`,
parentApiId: '<parent_api_id>',
reverseField: {
apiId: '<api_id>',
description: `<description>`,
displayName: '<Your Display Name>',
isHidden: `<boolean>`,
isList: `<boolean>`,
isUnidirectional: `<boolean>`,
modelApiId: '<model_api_id>',
visibility: `<visibility_types>`,
},
tableExtension: `<table_extension>`,
tableRenderer: `<table_renderer>`,
type: `<relational_field_type>`,
visibility: `<visibility_types>`,
});
  • apiId: String. Your relational field apiId.
  • description: Optional - String. Relational field description.
  • displayName: String. Display name that is used to render the relational field in the webapp.
  • formExtension: Optional - String.
  • formRenderer: Optional - String.
  • isHidden: Optional - Boolean. The relational field is hidden if true.
  • isList: Optional - Boolean.
  • isRequired: Optional - Boolean. The relational field is required if true. Only supported for RelationalFieldType.Asset.
  • modelApiId: Optional - String. Model apiId.
  • parentApiId: Optional - String. Parent apiId.
  • reverseField: Reverse relational field input.
    • apiId: String. Your reverse relational field apiId.
    • description: Optional - String. Description.
    • displayName: String. Reverse field display name.
    • isHidden: Optional - Boolean. The field is hidden if true.
    • isList: Optional - Boolean.
    • isUnidirectional: Optional - Boolean. The field is unidirectional if true.
    • modelApiId: String. Reverse field model apiId.
    • visibility: Visibility types.
  • tableExtension: Optional - String.
  • tableRenderer: Optional - String.
  • type: Relational field type. For example RelationalFieldType.Asset.
  • visibility: Optional. Visibility types.

#Delete relational field

Use deleteField method.

#Specific examples

#Required uni-directional asset field

client.createRelationalField({
parentApiId: '<parent_api_id>',
apiId: '<api_id>',
displayName: '<Your Display Name>',
type: RelationalFieldType.Asset,
isRequired: true,
reverseField: {
isUnidirectional: true,
apiId: '<api_id>',
displayName: '<Your Display Name>',
modelApiId: '<model_api_id>',
},
});

#M-n relation

client.createRelationalField({
parentApiId: '<parent_api_id>',
apiId: '<api_id>',
displayName: '<Your Display Name>',
type: RelationalFieldType.Relation,
isList: true,
reverseField: {
modelApiId: '<model_api_id>',
apiId: '<api_id>',
displayName: '<Your Display Name>',
isList: true,
},
});

#Union fields

#Create union field

client.createUnionField({
apiId: '<api_id>',
description: `<description>`,
displayName: '<Your Display Name>',
formExtension: `<form_extension>`,
formRenderer: `<form_renderer>`,
isHidden: `<boolean>`,
isList: `<boolean>`,
modelApiId: `<model_api_id>`,
parentApiId: '<parent_api_id>',
reverseField: {
apiId: '<api_id>',
description: `<description>`,
displayName: '<Your Display Name>',
isHidden: `<boolean>`,
isList: `<boolean>`,
modelApiIds: ['<model_api_id_1>', '<model_api_id_2>'],
visibility: `<visibility_types>`,
},
tableExtension: `<table_extension>`,
tableRenderer: `<table_renderer>`,
visibility: `<visibility_types>`,
});
  • apiId: String. Union field apiId.
  • description: Optional - String. Union field description.
  • displayName: String. Display name that is used to render the union field in the webapp.
  • formExtension: Optional - String.
  • formRenderer: Optional - String.
  • isHidden: Optional - Boolean. The relational field is hidden if true.
  • isList: Optional - Boolean.
  • modelApiId: Optional - String. Model apiId.
  • parentApiId: Optional - String. Parent apiId.
  • reverseField: Reverse union field input.
    • apiId: Optional - String.
    • description: Optional - String.
    • displayName: Optional - String.
    • isHidden: Optional - Boolean. The reverse relational field is hidden if true.
    • isList: Optional - Boolean.
    • modelApiIds: String. Model apiIds.
    • visibility: Visibility types.
  • tableExtension: Optional - String.
  • tableRenderer: Optional - String.
  • visibility: Visibility types.

#Update union field

client.updateUnionField({
apiId: '<api_id>',
description: `<description>`,
displayName: '<Your Display Name>',
modelApiId: `<model_api_id>`,
parentApiId: '<parent_api_id>',
reverseField: {
modelApiIds: ['<model_api_id_1>', '<model_api_id_2>'],
},
visibility: `<visibility_types>`,
});
  • apiId: String. Union field apiId.
  • description: Optional - String. Union field description.
  • displayName: String. Display name that is used to render the union field in the webapp.
  • modelApiId: Optional - String. Model apiId.
  • parentApiId: Optional - String. Parent apiId.
  • reverseField: updateReverseUnionField. Update reverse union field input.
    • modelApiIds: String. Model apiIds.
  • visibility: Visibility types.

#Delete union field

Use deleteField method.

#Components

#Create component

client.createComponent({
apiId: '<api_id>',
apiIdPlural: '<api_id_plural>',
description: `<your_description>`,
displayName: '<Your Display Name>',
});
  • apiId: String. Your component apiId.
  • apiIdPlural: String. The component's plural apiId. This is used for lists.
  • description: Optional - String. Your component description.
  • displayName: String. Display name that is used to render the component in the webapp.

#Update component

client.updateComponent({
apiId: '<api_id>',
apiIdPlural: '<api_id_plural>',
description: `<your_description>`,
displayName: '<Your Display Name>',
newApiId: `<new_api_id>`,
});
  • apiId: String. Your component apiId.
  • apiIdPlural: Optional - String. The component's plural apiId. This is used for lists.
  • description: Optional - String. Your component description.
  • displayName: Optional - String. Display name that is used to render the component in the webapp.
  • newApiId: Optional - String. New apiId.

#Delete component

client.deleteComponent({
apiId: '<api_id>',
});
  • apiId: String. The apiId of the component you wish to delete.

#Create component field

client.createComponentField({
apiId: '<api_id>',
componentApiId: `<component_api_id>`,
description: `<your_component_field_description>`,
displayName: '<Your Display Name>',
formExtension: `<form_extension>`,
formRenderer: `<form_renderer>`,
isList: `<boolean>`,
isRequired: `<boolean>`,
parentApiId: `<parent_api_id>`,
position: `<int>`,
tableExtension: `<table_extension>`,
tableRenderer: `<table_renderer>`,
visibility: `<visibility_types>`,
});
  • apiId: String. Your component field apiId.
  • componentApiId: String. Your component apiId.
  • description: Optional - String. Your component field description.
  • displayName: String. Display name that is used to render the component field in the webapp.
  • formExtension: Optional - String.
  • formRenderer: Optional - String.
  • isList: Optional - Boolean.
  • isRequired: Optional - Boolean. If true, the component field is required.
  • parentApiId: String. Parent apiId.
  • position: Optional - Integer.
  • tableExtension: Optional - String.
  • tableRenderer: Optional - String.
  • visibility: Optional. Visibility types.

#Update component field

client.updateComponentField({
apiId: '<api_id>',
description: `<your_component_field_description>`,
displayName: '<Your Display Name>',
isList: `<boolean>`,
isRequired: `<boolean>`,
newApiId: `<new_api_id>`,
parentApiId: `<parent_api_id>`,
visibility: `<visibility_types>`,
});
  • apiId: String. Your component field apiId.
  • description: Optional - String. Your component field description.
  • displayName: Optional - String. Display name that is used to render the component field in the webapp.
  • isList: Optional - Boolean.
  • isRequired: Optional - Boolean. If true, the component field is required.
  • newApiId: Optional - String. New apiId.
  • parentApiId: String. Parent apiId.
  • visibility: Optional. Visibility types.

#Delete component field

Use deleteField method.

#Specific examples

#Add a field to a component

client.createSimpleField({
parentApiId: '<parent_api_id>',
type: SimpleFieldType.String,
apiId: '<api_id>',
displayName: '<Your Display Name>',
});

#Create basic component field

client.createComponentField({
parentApiId: '<parent_api_id>',
apiId: '<api_id>',
displayName: '<Your Display Name>',
description: '<Your description>',
componentApiId: '<component_api_id>',
});

#Create a component union field

client.createComponentUnionField({
parentApiId: '<parent_api_id>',
apiId: '<api_id>',
displayName: '<Your Display Name>',
componentApiIds: ['<component_api_id_1>', '<component_api_id_2>'],
});

#Remove VideoBlock from a component union field

client.createComponentUnionField({
parentApiId: '<parent_api_id>',
apiId: '<api_id>',
displayName: '<Your Display Name>',
componentApiIds: [
'<contributor_component_api_id>',
'<videoblock_component_api_id>',
],
});

#Remote sources

#Create GraphQL remote sources

client.createGraphQlRemoteSource({
debugEnabled: `<boolean>`,
description: `<your_description>`,
displayName: `<Your Display Name>`,
headers: `<json>`,
introspectionHeaders: `<json>`,
introspectionMethod: `<get_or_post>`,
introspectionUrl: `<introspection_url>`,
prefix: `<prefix>`,
remoteTypeDefinitions: {
sdl: `<CreateRemoteTypeDefinition>`,
},
url: `<url>`,
});
  • debugEnabled: Optional - Boolean.
  • description: Optional - String. GraphQL remote source description.
  • displayName: String. Display name that is used to render the GraphQL remote source in the webapp.
  • headers: Optional - JSON.
  • introspectionHeaders: Optional - JSON. HTTP headers that will be used for introspection.
  • introspectionMethod: GraphQlRemoteSourceIntrospectionMethod. HTTP method that will be used for introspection.
  • introspectionUrl: Optional - String. Specific URL that will be used for introspection if the introspection is available on a URL other than the regular URL. Can be ignored if the introspection URL is the same as the URL of the remote source.
  • prefix: String.
  • remoteTypeDefinitions: Optional. CreateRemoteTypeDefinition. Custom GraphQL input types that can be used as arguments in remote fields that belong to this remoteSource.
    • sdl: String
  • url: String

#Update GraphQL remote sources

client.createGraphQlRemoteSource({
debugEnabled: `<boolean>`,
description: `<your_description>`,
displayName: `<Your Display Name>`,
headers: `<json>`,
introspectionHeaders: `<json>`,
introspectionMethod: `<get_or_post>`,
introspectionUrl: `<introspection_url>`,
prefix: `<prefix>`,
remoteTypeDefinitionsToUpsert: {
remoteTypeDefinitionsToCreate: `<remote_type_definitions_to_create>`,
remoteTypeDefinitionsToDelete: `<remote_type_definitions_to_delete>`,
remoteTypeDefinitionsToUpdate: `<remote_type_definitions_to_update>`,
},
url: `<url>`,
});
  • debugEnabled: Optional - Boolean.
  • description: Optional - String. GraphQL remote source description.
  • displayName: Optional - String. Display name that is used to render the GraphQL remote source in the webapp.
  • headers: Optional - JSON.
  • introspectionHeaders: Optional - JSON. HTTP headers that will be used for introspection.
  • introspectionMethod: GraphQlRemoteSourceIntrospectionMethod. HTTP method that will be used for introspection.
  • introspectionUrl: Optional - String. Specific URL that will be used for introspection if the introspection is available on a URL other than the regular URL. Can be ignored if the introspection URL is the same as the URL of the remote source.
  • prefix: String. Unique prefix that will be prepended to all of the remote types. This value cannot be changed.
  • remoteTypeDefinitionsToUpsert: Optional. CreateRemoteTypeDefinition. Custom GraphQL input types that can be used as arguments in remote fields that belong to this remoteSource.
    • remoteTypeDefinitionsToCreate: Optional Remote type definitions to create.
    • remoteTypeDefinitionsToDelete: Optional Remote type definitions to delete.
    • remoteTypeDefinitionsToUpdate: Optional Remote type definitions to update.
  • url: Optional - String

#Create REST remote sources

client.createRestRemoteSource({
debugEnabled: `<boolean>`,
description: `<your_description>`,
displayName: `<Your Display Name>`,
headers: `<json>`,
prefix: `<prefix>`,
remoteTypeDefinitions: {
sdl: `<CreateRemoteTypeDefinition>`,
},
url: `<url>`,
});
  • debugEnabled: Optional - Boolean.
  • description: Optional - String. REST remote source description.
  • displayName: String. Display name that is used to render the REST remote source in the webapp.
  • headers: Optional - JSON.
  • prefix: String. Unique prefix that will be prepended to all of the remote types. This value cannot be changed.
  • remoteTypeDefinitions: Optional. CreateRemoteTypeDefinition. Remote type definitions that the remote source supports, or input types that can be used by any remote field of this remote source.
    • sdl: String
  • url: String

#Update REST remote sources

client.updateRestRemoteSource({
debugEnabled: `<boolean>`,
description: `<your_description>`,
displayName: `<Your Display Name>`,
headers: `<json>`,
prefix: `<prefix>`,
remoteTypeDefinitionsToUpsert: {
remoteTypeDefinitionsToCreate: `<remote_type_definitions_to_create>`,
remoteTypeDefinitionsToDelete: `<remote_type_definitions_to_delete>`,
remoteTypeDefinitionsToUpdate: `<remote_type_definitions_to_update>`,
},
url: `<url>`,
});
  • debugEnabled: Optional - Boolean.
  • description: Optional - String. REST remote source description.
  • displayName: String. Display name that is used to render the REST remote source in the webapp.
  • headers: Optional - JSON.
  • prefix: String. Unique prefix that will be prepended to all of the remote types. This value cannot be changed.
  • remoteTypeDefinitionsToUpsert: Optional. CreateRemoteTypeDefinition. Remote type definitions that the remote source supports, or input types that can be used by any remote field of this remote source.
    • remoteTypeDefinitionsToCreate: Optional Remote type definitions to create.
    • remoteTypeDefinitionsToDelete: Optional Remote type definitions to delete.
    • remoteTypeDefinitionsToUpdate: Optional Remote type definitions to update.
  • url: String

#Delete remote source

client.deleteRemoteSource({
prefix: `<prefix>`,
});
  • prefix: String. The prefix of the remote source you wish to delete.

#Enumerations

#Create enumeration

client.createEnumeration({
apiId: `<your_app_id>`,
description: `<description>`,
displayName: `<display_name>`,
values: {
apiId: `<api_id>`,
displayName: `<display_name>`,
},
});
  • apiId: String. Enumeration apiId.
  • description: Optional - String. Enumeration description.
  • displayName: String. Display name that is used to render the enumeration in the webapp.
  • values: CreateEnumerationValue. Enumeration values.
    • apiId: String. Enumeration value apiId.
    • displayName: String. Display name that is used to render the enumeration value in the webapp.

#Update enumeration

client.updateEnumeration({
apiId: `<your_app_id>`,
description: `<description>`,
displayName: `<display_name>`,
newApiId: `<new_api_id>`,
valuesToCreate: {
apiId: `<api_id>`,
displayName: `<display_name>`,
},
valuesToDelete: [`<value_1>`, `<value_2>`],
valuesToUpdate: {
apiId: `<api_id>`,
displayName: `<display_name>`,
newApiId: `<new_api_id>`,
},
});
  • apiId: String. Enumeration apiId.

  • description: Optional - String. Enumeration description.

  • displayName: String. Display name that is used to render the enumeration in the webapp.

  • newApiId: Optional - String. New apiId.

  • valuesToCreate: Optional - String. createEnumerationValue. Enumeration values to be created.

    • apiId: String. Enumeration value apiId.
    • displayName: String. Display name that is used to render the enumeration value in the webapp.
  • valuesToDelete: Optional - String. Values to delete.

  • valuesToUpdate: Optional - String. updateEnumerationValue. Enumeration values to be updated..

    • apiId: String. Enumeration value apiId.
    • displayName: Optional - String. Display name that is used to render the enumeration value in the webapp.
    • newApiId: Optional - String. New apiId.

#Delete enumeration

client.deleteEnumeration({
apiId: `<your_app_id>`,
});
  • apiId: String. apiId of the enumeration you wish to delete.

#Create enumerable field

client.createEnumerableField({
apiId: 'enumField',
description: 'Description',
displayName: 'Enum Field',
parentApiId: 'Post',
enumerationApiId: 'Variation',
});
  • apiId: String. Enumerable field apiId.
  • description: Optional - String. Enumerable field description.
  • displayName: String. Display name that is used to render the enumerable field in the webapp.
  • parentApiId: String. Parent apiId.
  • enumerationApiId: String. Enumeration apiId.

#Update enumerable field

client.updateEnumerableField({
apiId: 'enumField', // required
parentApiId: 'Test', // required
description: 'Description',
displayName: 'Enum Field Update',
initialValue: 'Value 1',
isHidden: false,
isList: false,
isLocalized: false,
isRequired: false,
isTitle: false,
isUnique: false,
migrationValue: 'Value 1',
position: 0,
visibility: 'READ_WRITE',
});
  • apiId: Required - String. Enumerable field apiId.
  • parentApiId: Required - String. Parent apiId.
  • description: Optional - String. Enumerable field description.
  • displayName: String. Display name that is used to render the enumerable field in the webapp.
  • initialValue: String. Initial value of the field.
  • isHidden: Optional - Boolean. Makes the field hidden if true.
  • isList: Optional - Boolean.
  • isLocalized: Optional - Boolean.
  • isRequired: Optional - Boolean. Makes the field required if true.
  • isTitle: Optional - Boolean.
  • isUnique: Optional - Boolean.
  • migrationValue: String. Migration value of the enumerable field.
  • position: Optional - Integer.
  • visibility: Field visibility, for example VisibilityTypes.ReadWrite.

#Delete enumerable field

Use deleteField method.

#Locales

#Create locale

client.createLocale({
apiId: `<your_app_id>`,
description: `<description>`,
displayName: `<Display Name>`,
});
  • apiId: String. Locale apiId.
  • description: Optional - String. Locale description.
  • displayName: String. Display name associated with the locale.

#Update locale

client.updateLocale({
apiId: `<your_app_id>`,
description: `<description>`,
displayName: `<Display Name>`,
isDefault: `<boolean>`,
newApiId: `<new_api_id>`,
});
  • apiId: String. Locale apiId.
  • description: Optional - String. Locale description.
  • displayName: Optional - String. Display name associated with the locale.
  • isDefault: Optional - Boolean. If true, this is the default locale.
  • newApiId: Optional - String. New apiId.

#Delete locale

client.deleteLocale({
apiId: `<your_app_id>`,
force: `<boolean>`,
});
  • apiId: String. Locale apiId.
  • force: Optional - Boolean. If true, deletion is forced.

#Stages

#Create stage

client.createStage({
apiId: `<your_app_id>`,
color: `<color>`,
description: `<description>`,
displayName: `<Display Name>`,
position: `<int>`,
});
  • apiId: String. Your stage apiId.
  • color: Select from ColorPalette.
  • description: Optional - String. Your stage description.
  • displayName: String. Display name associated with the stage.
  • position: Optional - Integer.

#Update stage

client.updateStage({
apiId: `<your_app_id>`,
color: `<color>`,
description: `<description>`,
displayName: `<Display Name>`,
newApiId: `<new_api_id>`,
position: `<int>`,
});
  • apiId: String. Your stage apiId.
  • color: Optional. Select from ColorPalette.
  • description: Optional - String. Your stage description.
  • display: Optional - String. Display name associated with the stage.
  • newApiId: Optional - String. New apiId.
  • position: Optional - Integer.

#Delete stage

client.deleteStage({
apiId: `<your_app_id>`,
});
  • apiId: String. apiId of the stage you wish to delete.

#Apps

#Create app

This example shows how to create an app installation in an environment.

// config can be any valid object used to configure the app. This will change from app to app. Refer to the app's documentation, if available, for the shape of this object.
client.createAppInstallation({
config: {
apiKey: "",
telemetry: false,
},
appApiId: "app.api.id",
});
  • appApiId: String. The unique API ID of the app to install.
  • config: Object (Optional). The app's configuration settings.
    • apiKey: String (Nullable). API key for authentication, if required.
    • telemetry: Boolean. A flag indicating whether to enable or disable telemetry (tracking of usage data). false means telemetry is disabled.

When an app is installed via the createAppInstallation method, it is always installed with the INCOMPLETE status. Users with the necessary permissions (usually the ADMIN or DEVELOPER roles) must complete the app installation process in Hygraph Studio.

Currently, to use the createAppInstallation method, the app needs to exist in at least one environment within the project. Users can't use this method to install new apps, only apps that they've previously installed in an existing environment.

#Delete app

This example shows how to remove an app installation from an environment.

client.deleteAppInstallation({ appApiId: "app.api.id" });
  • appApiId: String. The unique API ID of the app to uninstall.

#Custom renderers and app fields

  1. To create a simple field with custom table and form renderers in an environment, first retrieve the appApiId and appElementApiId using the Management API.

    query test {
    viewer {
    project(id: "<projectId>") {
    environment(name: "<environment_name>") {
    appInstallation(appApiId: "<app_name>") {
    id
    app {
    id
    apiId
    elements {
    id
    apiId
    type
    }
    }
    }
    }
    }
    }
    }
  2. Now, create the simple field with custom table and form renderers in the specified environment.

    client.createSimpleField({
    environmentId: "<your-environment-id>",
    parentApiId: "Car",
    apiId: "appField",
    type: "STRING",
    displayName: "App Field",
    description: null,
    initialValue: null,
    tableRenderer: "CUSTOM",
    formRenderer: "CUSTOM",
    tableExtension: null,
    formExtension: null,
    formConfig: {
    alg_text_name: "Some custom text",
    appApiId: "myapp-test",
    appElementApiId: "myAppField"
    },
    tableConfig: {
    appApiId: "myapp-test",
    appElementApiId: "myAppField"
    },
    isList: false,
    isLocalized: false,
    isRequired: false,
    isUnique: false,
    isHidden: false,
    embeddableModels: [],
    visibility: "READ_WRITE",
    isTitle: false,
    position: 8,
    validations: null,
    embedsEnabled: null,
    visibilityCondition: null
    });
  • environmentId: String. The ID of the environment where the field will be created.
  • parentApiId: String. The API ID of the parent model (e.g., "Car").
  • apiId: String. The unique API ID for the field.
  • type: String. Defines the field type (e.g., "STRING").
  • displayName: String. The human-readable name of the field.
  • description: String (Optional). A description of the field, if applicable.
  • initialValue: String (Optional). The default value of the field.
  • tableRenderer: String. Specifies how the field is rendered in the table view ("CUSTOM" in this case).
  • formRenderer: String. Specifies how the field is rendered in the form view ("CUSTOM" in this case).
  • tableExtension: String (Optional). Extension used for the table renderer.
  • formExtension: String (Optional). Extension used for the form renderer.
  • formConfig: Object (Optional). Configuration for the form renderer.
    • alg_text_name: String. Custom text for the form field.
    • appApiId: String. The API ID of the related app.
    • appElementApiId: String. The API ID of the related app field.
  • tableConfig: Object (Optional). Configuration for the table renderer.
    • appApiId: String. The API ID of the related app.
    • appElementApiId: String. The API ID of the related app field.
  • isList: Boolean. Determines if the field supports multiple values.
  • isLocalized: Boolean. Determines if the field supports multiple locales.
  • isRequired: Boolean. Determines if the field is mandatory.
  • isUnique: Boolean. Determines if the field value must be unique.
  • isHidden: Boolean. Determines if the field is hidden from editors.
  • embeddableModels: Array. A list of models that can be embedded in this field.
  • visibility: String. Defines the field's visibility ("READ_WRITE", "READ_ONLY", etc.).
  • isTitle: Boolean. Determines if this field is used as the model's title field.
  • position: Integer. The position of the field in the schema.
  • validations: Object (Optional). Contains validation rules for the field.
  • embedsEnabled: Boolean (Optional). Determines if embedded content is allowed.
  • visibilityCondition: Object (Optional). Defines conditional visibility rules for the field.

#Manage sidebar elements

You can manage sidebar elements using the updateModel method on the client.

The following example shows how to create, update and delete both system & custom sidebar elements:

client.updateModel({
apiId: "modelApiId",
sidebarElementsToUpsert: {
systemSidebarElementsToCreate: [{
type: SystemSidebarElementType.PreviewUrls,
position: 2,
// config: Only required for the PreviewUrls SystemSidebarElementType
config: {
preview_urls: [{
name: "Staging web",
template: "https://staging.example.com/{id}"
}]
},
}, {
type: SystemSidebarElementType.Versions,
position: 3,
}],
customSidebarElementsToCreate: [{
appApiId: "apiId for the app",
appElementApiId: "apiId for the specifi app element",
displayName: "Display name for the sidebar element",
description: "Description",
position: 3,
// any config required by the app that owns/renders this sidebar element
config: {},
}],
sidebarElementsToUpdate: [{
displayName: "existing sidebar element",
newDisplayName: "new name for the sidebar element",
description: "changed description of the sidebar element",
// any config required by the app that owns/renders this sidebar element
config: {},
position: 4,
}],
customSidebarElementsToDelete: [{
appApiId: "apiId of the app",
appElementApiId: "apiId of the appElement",
}],
systemSidebarElementsToDelete: [{
type: SystemSidebarElementType.Releases,
},
{
type: SystemSidebarElementType.Localizations,
}],
},
});
  • apiId: String. The unique API ID of the model to update.
  • sidebarElementsToUpsert: Object. The object containing arrays of sidebar elements to create, update, or delete.
    • systemSidebarElementsToCreate: Array. An array of system sidebar elements to add to the model.
      • type: SystemSidebarElementType. The type of system sidebar element (e.g., PreviewUrls, Versions, etc.).
      • position: Number. The position where the sidebar element will be displayed.
      • config: Object. Only required for PreviewUrls type. Contains URL configuration details.
        • preview_urls: Array. A list of preview URLs to add, including:
          • name: String. The display name for the URL.
          • template: String. The URL template, including placeholders like id.
    • customSidebarElementsToCreate: Array. An array of custom sidebar elements to add to the model.
      • appApiId: String. The API ID of the app to which the sidebar element belongs.
      • appElementApiId: String. The API ID of the specific app element.
      • displayName: String. The display name for the sidebar element.
      • description: String. A description of the sidebar element.
      • position: Number. The position where the sidebar element will be displayed.
      • config: Object. Any configuration required by the app that renders this sidebar element.
    • sidebarElementsToUpdate: Array. An array of existing sidebar elements to update.
      • displayName: String. The current display name of the sidebar element.
      • newDisplayName: String. The updated display name of the sidebar element.
      • description: String. The updated description of the sidebar element.
      • config: Object. Any configuration required by the app that renders this sidebar element.
      • position: Number. The updated position where the sidebar element will be displayed.
    • customSidebarElementsToDelete: Array. An array of custom sidebar elements to delete.
      • appApiId: String. The API ID of the app to which the sidebar element belongs.
      • appElementApiId: String. The API ID of the specific app element to delete.
    • systemSidebarElementsToDelete: Array. An array of system sidebar elements to delete.
      • type: SystemSidebarElementType. The type of system sidebar element to delete (e.g., Releases, Localizations, etc.).

#Remote fields

#Create remote field

This example shows how to create a remote field for fetching product reviews from an external API.

client.createRemoteField({
environmentId: "<your-environment-id>",
parentApiId: "Product",
apiId: "productReviews",
displayName: "Product Reviews",
description: "Fetches reviews for a product from an external API",
remoteSourceId: "<your-remote-source-id>",
method: "GET",
path: "/api/reviews/product/{{doc.productId}}",
returnType: "ReviewMeta",
inputArguments: [
{
apiId: "productId",
type: "STRING",
isRequired: true
}
],
visibility: "READ_WRITE",
isList: false,
isLocalized: false,
isRequired: false,
isUnique: false,
isHidden: false,
position: 5
});
  • environmentId: String. The ID of the environment where the remote field will be created.
  • parentApiId: String. The API ID of the parent model (e.g., "Product").
  • apiId: String. The unique API ID for the remote field.
  • displayName: String. The human-readable name of the field.
  • description: String (Optional). A brief explanation of the field's purpose.
  • remoteSourceId: String. The ID of the remote source where data will be fetched from.
  • method: String. The HTTP method used to fetch data ("GET", "POST", etc.).
  • path: String. The API endpoint path where data is retrieved.
  • returnType: String. The expected return type of the remote field (e.g., "ReviewMeta").
  • inputArguments: Array of Objects. The parameters required for the remote request.
    • apiId: String. The API ID of the input argument.
    • type: String. The data type of the argument (e.g., "STRING").
    • isRequired: Boolean. Defines whether the argument is mandatory.
  • visibility: String. Defines the field's visibility ("READ_WRITE", "READ_ONLY", etc.).
  • isList: Boolean. Determines if the field can store multiple values.
  • isLocalized: Boolean. Determines if the field supports multiple locales.
  • isRequired: Boolean. Defines whether the field must always have a value.
  • isUnique: Boolean. Defines whether values must be unique across entries.
  • isHidden: Boolean. Determines if the field is hidden from the UI.
  • position: Integer. The position of the field in the schema.

#Update remote field

This example shows how to update an existing remote field.

client.updateRemoteField({
environmentId: "<your-environment-id>",
parentApiId: "Product",
apiId: "externalStock",
newConfig: {
remoteFieldPath: "data.stock",
type: "INTEGER"
}
});
  • environmentId: String. The ID of the environment where the remote field exists.
  • parentApiId: String. The API ID of the parent model (e.g., "Product").
  • apiId: String. The unique API ID of the remote field to update.
  • newConfig: Object. The updated configuration settings for the remote field.
    • remoteFieldPath: String. Specifies the new data path within the remote source.
    • type: String. Defines the updated data type of the remote field (e.g., "INTEGER").

#Delete remote field

This example shows how to delete a remote field from a model.

client.deleteRemoteField({
environmentId: "<your-environment-id>",
parentApiId: "Product",
apiId: "legacyPrice"
});
  • environmentId: String. The ID of the environment where the remote field exists.
  • parentApiId: String. The API ID of the parent model (e.g., "Product").
  • apiId: String. The unique API ID of the remote field to delete.

#Conditional visibility

We can modify the visibility conditions for a number of field types, such as: SIMPLE_FIELD, RELATIONAL_FIELD, ENUMERABLE_FIELD, UNION_FIELD and COMPONENT_FIELD.

The visibilityCondition property is available on the createXXXField and updateXXXField methods for these field types.

#Change visibility condition

This example shows how to change the visibility condition of a field with an enumeration or a boolean:

// For an enumerable baseField
client.updateSimpleField({
apiId: "conditionalFieldOne",
parentApiId: "ModelApiId",
visibilityCondition: {
baseField: "buildingMaterial", // apiId of the baseField (in this case an enumerable field)
operator: FieldConditionOperator.Is,
booleanValue: null,
enumerationValues: ["plexiGlass"], // an array of apiId for the referenced enumerationValues
},
});
// OR with a boolean baseField
client.updateSimpleField({
apiId: "conditionalFieldTwo",
parentApiId: "ModelApiId",
visibilityCondition: {
baseField: "isMobileApp", // apiId of the baseField (in this case a boolean field)
operator: FieldConditionOperator.Is,
booleanValue: true,
enumerationValues: null,
},
});
  • apiId: String. The unique API ID of the simple field to update.
  • parentApiId: String. The API ID of the parent model to which the simple field belongs.
  • visibilityCondition: Object. Defines the condition that determines when this field should be visible. Contains the following properties:
    • baseField: String. The API ID of the base field that triggers visibility.
      • For enumerations: The base field must be an enumerable field.
      • For booleans: The base field must be a boolean field.
    • operator: FieldConditionOperator. The operator used to evaluate the visibility condition. Example: "Is".
    • booleanValue: Boolean (Nullable). Specifies the value to trigger visibility if the base field is boolean. Set to null if the base field is an enumerable.
    • enumerationValues: Array (Nullable). An array of API IDs representing the enumeration values that trigger visibility if the base field is enumerable. Set to null if the base field is boolean.

#Remove visibility condition

This example shows how to remove the visibility condition of a field.

client.updateSimpleField({
apiId: "conditionalFieldOne",
parentApiId: "ModelApiId",
visibilityCondition: null,
});
  • apiId: String. The unique API ID of the simple field to update.
  • parentApiId: String. The API ID of the parent model to which the simple field belongs.
  • visibilityCondition: Nullable. If Null, no visibility condition is applied and the field is always visible.