Brightspot Integrations Guide

Creating a GraphQL mutation for the Zapier integration


You can create a GraphQL mutation that enables Zapier to modify Brightspot assets. For example, an editor working in a Google Doc can trigger the creation of an article in Brightspot. Once created, this mutation appears in Zapier as an action event for use in a zap.

To create a GraphQL mutation for the Zapier integration:

  1. Click menu > Admin > Zapier.
  2. From the Create list, select GraphQL Mutation, then click New.
  3. Enter an internal name for this asset. Brightspot uses this name internally, such as in the search panel and recent activity widget. This name is not visible to visitors to your site.
  4. In the Description field, enter a description about what this mutation achieves, such as Publishes new article in Brightspot.
  5. In the Zapier Label field, enter a value that will appear when creating actions in Zapier. Use something short, but descriptive of the what the query achieves (for example, Publish New Article).
  6. Under Endpoint, select the GraphQL API endpoint you added that you associated to the API client. For details, see Adding API endpoints for the Zapier integration.
  7. Under Mutation, enter the desired mutation. Brightspot recommends using the GraphQL explorer to more easily build the mutation from the schema. (To use the GraphQL explorer, you must have the developer permission HTML Toggle). See the example below for a simple mutation that publishes a new article.
    mutation MyMutation($headline: String = "", $body: String = "") {
      Save {
        Record(
          args: {diffs: {ArticleDiff: {headline: {html: $headline}, body: {html: $body}}}, urls: {generate: {}}}
          context: {dryRun: false, site: {_name: "Demo"}}
        ) {
          state {
            ... on Article {
              __typename
              _id
            }
          }
        }
      }
    }
    
  8. Click Publish.

Once published, this mutation appears in Zapier as an action event for use in a zap.

Note
Once published, you may view analytics pertaining to this asset in the Analytics tab. The tab includes when it was last used, its success count, the number of its total requests, and the number of errors it has generated.

Previous Topic
Creating a GraphQL query for the Zapier integration
Next Topic
Creating a general Zapier search
Was this topic helpful?
Thanks for your feedback.
Our robust, flexible Design System provides hundreds of pre-built components you can use to build the presentation layer of your dreams.

Asset types
Module types
Page types
Brightspot is packaged with content types that get you up and running in a matter of days, including assets, modules and landing pages.

Content types
Modules
Landing pages
Everything you need to know when creating, managing, and administering content within Brightspot CMS.

Dashboards
Publishing
Workflows
Admin configurations
A guide for installing, supporting, extending, modifying and administering code on the Brightspot platform.

Field types
Content modeling
Rich-text elements
Images
A guide to configuring Brightspot's library of integrations, including pre-built options and developer-configured extensions.

Google Analytics
Shopify
Apple News