Hygraph
Connect to Hygraph, a GraphQL headless CMS, to list content models and read, create, update, publish, and unpublish entries.
Connectors
Choose the connector that matches your authentication method. The options below use the names shown in StackAI.
Hygraph
Permanent Auth Token
Hygraph
Connect to a Hygraph project with a Permanent Auth Token to list content models, and read, create, update, publish, and unpublish entries.
Set up in Hygraph
Prepare the Hygraph account or service that the workflow will access. Grant access to the required resources and operations.
Content API Endpoint: The project's read/write Content API URL from Project Settings > Endpoints, e.g. https://api-eu-central-1.hygraph.com/v2/<projectId>/master. Do not use the High Performance read-only endpoint (cdn.hygraph.com/content/...): it rejects creates, updates, and publishing. Must be a hygraph.com or graphcms.com address.
Permanent Auth Token: Create at Project Settings > API Access > Permanent Auth Tokens. Grant Read plus Create/Update/Delete/Publish/Unpublish on the models this connection will use.
Set up in StackAI
Open Settings → Connections, add a connection, and select Hygraph.
Enter the credentials and connection details in the fields below.
Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.
Connection fields
Content API Endpoint
Yes
The project's read/write Content API URL from Project Settings > Endpoints, e.g. https://api-eu-central-1.hygraph.com/v2/<projectId>/master. Do not use the High Performance read-only endpoint (cdn.hygraph.com/content/...): it rejects creates, updates, and publishing. Must be a hygraph.com or graphcms.com address. Provider instructions.
Permanent Auth Token
Yes
Create at Project Settings > API Access > Permanent Auth Tokens. Grant Read plus Create/Update/Delete/Publish/Unpublish on the models this connection will use. Provider instructions.
Verify the connection
Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.
If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.
Use an action
Add the required Hygraph action to the workflow.
Select a connection when the action requests one.
Complete the required fields. Use the reference picker when a value comes from another workflow step.
Run the workflow and inspect the action’s output. Check the result before using it in a later step.
Actions
List Models
List the content models in your Hygraph project, such as Post or Product.
Inputs
No input fields are required in this catalog entry.
Outputs
Models
object_array
Content models with their API ids.
Get Model Fields
See the fields of a model, their types, and which are required.
Inputs
Model
select (string)
Yes
The content model to inspect. Options load from the selected connection.
Outputs
Model
string
The model that was inspected.
Fields
object_array
The model's fields.
List Entries
Find entries of a model, optionally matching a search term or filter.
Inputs
Model
select (string)
Yes
The content model to list entries from. Options load from the selected connection.
Search
string
No
Only return entries whose text contains this term.
Content Stage
select (string)
No
Draft shows the latest edits; Published shows what is live. Options load from the selected connection. Default: DRAFT.
Show advanced options
boolean
No
Show locale, filter, sort order, and cursor options. Default: false.
Locale
select (string)
No
Return localized fields in this language. Options load from the selected connection.
Filter (JSON)
textarea
No
Advanced: a Hygraph where filter as JSON.
Order By
string
No
Sort order, e.g. newest first.
Max Results
integer
No
Maximum number of entries to return. Minimum: 1. Maximum: 500. Default: 25.
Cursor
string
No
Continue from a previous result.
Outputs
Entries
object_array
Matching entries.
Next Cursor
string
Pass this back to get more results.
Count
integer
Number of entries returned.
Get Entry
Get one entry by its ID.
Inputs
Model
select (string)
Yes
The entry's content model. Options load from the selected connection.
Entry ID
string
Yes
The ID of the entry.
Content Stage
select (string)
No
Draft shows the latest edits; Published shows what is live. Options load from the selected connection. Default: DRAFT.
Locale
select (string)
No
Return localized fields in this language. Options load from the selected connection.
Outputs
Found
boolean
Whether the entry exists.
Entry
object
The entry's fields.
Create Entry
Create a new entry, and optionally publish it right away.
Inputs
Model
select (string)
Yes
The content model to create an entry in. Options load from the selected connection.
Fields (JSON)
textarea
Yes
The entry's field values as JSON.
Publish After Creating
boolean
No
Make the new entry live immediately. Default: false.
Locale
select (string)
No
Publish this locale along with the default one. Options load from the selected connection.
Outputs
Entry
object
The created entry.
Published
boolean
Whether it was published.
Update Entry
Change fields on an existing entry, and optionally publish the change.
Inputs
Model
select (string)
Yes
The entry's content model. Options load from the selected connection.
Entry ID
string
Yes
The ID of the entry to change.
Fields to Change (JSON)
textarea
Yes
Only the fields you want to change, as JSON.
Publish After Updating
boolean
No
Make the change live immediately. Default: false.
Locale
select (string)
No
Update and publish this locale. Options load from the selected connection.
Outputs
Entry
object
The updated entry.
Published
boolean
Whether it was published.
Delete Entry
Permanently delete an entry from every stage.
Inputs
Model
select (string)
Yes
The entry's content model. Options load from the selected connection.
Entry ID
string
Yes
The ID of the entry to delete.
Outputs
Deleted
boolean
Whether an entry was deleted.
Entry ID
string
The ID that was deleted.
Publish Entry
Make an entry's latest draft live.
Inputs
Model
select (string)
Yes
The entry's content model. Options load from the selected connection.
Entry ID
string
Yes
The ID of the entry to publish.
Locale
select (string)
No
Also publish this locale. Options load from the selected connection.
Outputs
Entry
object
The published entry.
Unpublish Entry
Take an entry offline while keeping its draft.
Inputs
Model
select (string)
Yes
The entry's content model. Options load from the selected connection.
Entry ID
string
Yes
The ID of the entry to unpublish.
Locale
select (string)
No
Only unpublish this locale. Options load from the selected connection.
Outputs
Unpublished
boolean
Whether the entry was taken offline.
Entry ID
string
The entry's ID.
Run GraphQL Query
Run any GraphQL query or mutation against your Hygraph Content API.
Inputs
GraphQL Query
textarea
Yes
The GraphQL query or mutation to run.
Variables (JSON)
textarea
No
Values for $variables in the query, as JSON.
Outputs
Data
object
The query result.
Important behavior
Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.
The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.
Last updated
Was this helpful?

