Cosmic Changelog

Follow the changelog for release news, product enhancements, and new features. Follow us on Twitter and join us in Slack to keep up with the latest.

Dashboard Updates: New Thumbnails, Search and Filter, and more


We're happy to announce some updates that will make your workflows in the Cosmic admin dashboard easier and more enjoyable. This release includes the following updates:

  1. Object thumbnails
  2. New Object Metafield selection logic
  3. Search / filter fixes
  4. Bucket thumbnail now in settings


1. Object Thumbnails
You can now add thumbnails to Objects. This gives you the ability to add visual differentiation in your Objects table. You can also select your Object thumbnail from any Image Metafield.


2. New Object Metafield Selection Logic
Before, single Object Metafields gave you the option to select Objects via a select dropdown. This made it impossible to select from an Object Type list of more than 1,000 (our API limit). Now, you can use the Select Object modal to search as well as use pagination to find your Objects. Plus you can also "Quick Add" an Object Type, which should help you create Object relationships much faster.


3. Search / Filter Fixes
You will now notice that the Search / Filter modal has been simplified and improved. Search for content quickly and easily.


4. Bucket Thumbnail
You can now edit your Bucket thumbnail from the Bucket Settings page.


We hope you enjoy these dashboard updates. Please let us know if you have any questions / comments in our Slack channel, and follow us on Twitter for the latest updates to the Cosmic Headless CMS.

Introducing New Bulk Actions


We are excited to announce a big release that enables you to effortlessly perform new bulk actions from your Cosmic admin dashboard, giving your team even greater content ops superpowers.

Bulk Edits and Search and Replace are two separate features that provide your team with huge time-savings when you need to make changes affecting multiple Objects. Let's look at what each feature does and how to use them...


What are Bulk Edits?Bulk Edit Dropdown

Bulk Edits allow you to edit fields across multiple Objects in your Bucket. For example, editing a Metafield to the same value across multiple Blog Posts used to require you to manually edit the value in every Object. Now, with Bulk Edits, you can do this in a single action saving you minutes of manual work (or hours, or more!).



How to use Bulk Edits

To use the Bulk Edits feature:

  1. Log into your Cosmic account.
  2. Select your Bucket.
  3. Go to your Objects table view by selecting any Object Type in the left-hand side nav.
  4. Use the left-side checkbox next to each Object to select which Objects to perform the action on.
  5. Click the "Bulk Edit Objects" option from the "Bulk Actions" dropdown at the top of the table.
  6. Select the fields you want to affect, add your new values, and click "Confirm".

You can currently perform bulk edits on Object content and select Metafield values.

See the video for steps:


What is Search and Replace?
Search Replace Dropdown

The Search and Replace bulk action enables you to search and replace text across Objects. For example, if you needed to replace an old link with a new link across multiple Objects and fields, you can now use the Search and Replace bulk action to do this in a single action within seconds. Before you would have had to manually edit each Object which could have taken minutes (or hours, or more!).


How to use Search and Replace

To use the Search and Replace feature:

  1. Log into your Cosmic account.
  2. Select your Bucket.
  3. Go to your Objects table view by selecting any Object Type in the left-hand side nav.
  4. Use the left-side checkbox next to each Object to select which Objects to perform the action on.
  5. Click the "Search and Replace" option from the "Bulk Actions" dropdown at the top of the table.
  6. Add the term to search for (case sensitive) and the term that will replace it.
  7. Select the fields to perform the action on. Click "Confirm".

You can currently perform search and replace on Object title, content, and select Metafield values.

See the video for steps:


Bulk Edits and Search and Replace are two new tools in your Cosmic toolbox to help you achieve the same goal: saving time!

We hope you enjoy using the new bulk actions. Please let us know if you have any questions / comments in our Slack channel, and follow us on Twitter for the latest updates to the Cosmic Headless CMS.

Webhook triggers via API, NPM modules updates, and more


We have a few exciting updates to help you power content for your modern websites and apps using Cosmic.


1. Trigger webhooks via API
You can now trigger webhooks using the API by passing trigger_webhook=true in the request body. Find your webhooks in Bucket Settings > Webhooks. Be sure to check out the Webhooks documentation and API documentation to see with which API requests this is possible (Add, Edit, and Delete Objects and Media).


2. Edit Object via API using id
We have added the functionality to edit Objects via the API using id.  Which gives you the ability to edit the Object slug (which was previously not possible). Be sure to check this out in our Edit Object API documentation.


3. Cosmic NPM module updates
Check out the latest release of Cosmic NPM module. The new version includes the following updates: 

  • Performance updates (up to 10x faster install!)
  • Codebase improvements (Refactoring and modularization)
  • Babel and webpack version bump
  • Production packages/dependencies shrink down

This update will improve the overall developer experience as well as you'll able to deliver content to users much faster 🚀. 


4. Cosmic Gatsby source plugin updates
We've updated the packages/dependencies in the Gatsby source plugin for Cosmic and fixed localMedia bugs related to Object & Objects metafields. Check out the latest version here.


We hope you enjoy these updates. If you have any questions, join our Slack community and reach out to us on Twitter.

Introducing Advanced Queries


We are excited to announce the release of Advanced Queries (Beta) now available for all accounts. This is huge for teams that would like to use Cosmic beyond basic content management, enabling laser-focused logic to deliver content.

How it works
Advanced queries give you powerful NoSQL database-like functionality for data fetching. Using the Cosmic REST API endpoint and available clients (including the Cosmic GraphQL API) you can customize your NoSQL-style query (in JSON format) to customize selectors and query logic. See below examples and the docs for more info.





Examples

To keep things concise, use the following bucket variable for the following examples.

const bucket = Cosmic.bucket({
  slug: 'bucket-slug',
  read_key: "your-read-key-found-in-bucket-settings"
});


Match Objects with exact title

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "title": "Post 1"
  }
});


Match Objects greater than or equal to metadata value

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "metadata.price": {
      "$gte": 9.99
    }
  }
});


Match Objects with nested JSON metadata value (JSON Metafield)

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "metadata.json_data": {
      "is_awesome": true,
      "other_data": {
        "nested": "yep"
      }
    }
  }
});


Match Objects with any metadata values

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "$or": [
      {
         "metadata.grade": "A"
      },
      {
        "metadata.grade": "B"
      }
    ]
  }
});


Match Objects with string in content using a regular expression. Case insensitive with $options.

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "content": {
      "$regex": "jamstack",
      "$options": "i"
    }
  }
});


Match Objects with any Multiple Object Metafield values

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "metadata.categories": {
      "$in": ["category_id-1","category_id-2"]
    }
  }
});


Match Objects that don't have any Multiple Object Metafield values

bucket.getObjects({
  type: 'posts',
  props: 'slug,title,content',
  query: {
    "metadata.categories": {
      "$nin": ["category_id-1","category_id-2"]
    }
  }
});

See the docs for the full list of query selectors and logic operators.


Advanced Queries in the GraphQL API
You may need to set the variable outside of the main query area. Add something like this to the Query Variables area:

{
  "query": {
    "title": {
      "$regex": "another",
      "$options": "i"
    }
  }
}


View full screen  


We hope you enjoy using Advanced Queries to give you more power and flexibility to get your Cosmic content. This is a Beta release and we would like your feedback as we improve this feature, so please let us know what you think! Reach out to us on Twitter and join the conversation in Slack.

Next.js Static Blog, Increased Media Upload Size Limit, and more


We have a few exciting updates to help you power content for your modern websites and apps using Cosmic.


1. Next.js Static Blog
Check out the newest app in our Apps Marketplace to help you learn how to use Cosmic with the Next.js framework. The new Next.js Static Blog includes draft content preview functionality, automatic image optimization, and has a killer lighthouse score 😍 


2. Increased Media Upload in the API
We've now increased the size limit on file uploads to the REST API limit to 900MB. Check out the details in the documentation. So enjoy uploading all those home movies via our API 😀 


3. Workspaces navigation update
You will now notice that you have easier access to your workspaces. Located in the top right nav dropdown after logging in, you can see your listed workspaces and get to those projects faster (no Slack issues here). This makes switching between workspaces much easier. Contact sales to get your white label company-branded workspace set up.

4. Localization Improvements
We've improved the process of creating localized content. On the Edit Object page for localized content, you will now see a button that says "Add New Version" if a new localized version is available. You will also see a list of created localized versions for easy access.


We hope you enjoy these updates. If you have any questions, join our Slack community and reach out to us on Twitter.

Two-Factor Authentication, Emoji Nav Icons, and Database Upgrade


We've got an exciting release for you which includes two-factor authentication, new emoji nav icons, and a big database upgrade.

🔒Two-Factor Authentication
Two-factor authentication is now available on all accounts for free. Go to Account Settings > Two-Factor Authentication to connect your account to your mobile phone for an added layer of security. This feature does not apply to users using a third-party login such as Google, GitHub, or SSO.



🚀Emoji Nav Icons
You can now add Emojis to the Object Type sidebar nav. Go to Object Type > Settings to replace the default folder icon with any one of your favorite emojis. This is a great way to organize content visually, and also fun.



⚡MongoDB Database Upgrade
You may not have noticed, but we've recently undergone a pretty massive database upgrade and migration. What you MAY have noticed is that the dashboard and API requests (non-cached endpoints) are now up to 50% faster and more resilient to sudden bursts of traffic. This is because our database is now powered by the best-in-class, auto-scaling infrastructure at MongoDB Atlas.


We hope you enjoy these new features, security, and infrastructure upgrades. We're constantly improving our service to make your experience better. If you have any questions or comments, please feel free to reach out to us on Twitter and join our community on Slack.

UX Updates, Sort Metafields, and more


We're happy to let you know about some great user experience improvements. For this release, we focused on improving the Edit Object process, content editor experience, and also squeezed in a request for an improvement to scheduled publishing.


1. Edit Object Improvements
You will now notice that we simplified the edit Object module on the right side of the Dashboard. Along with a less-busy UI, the UX is also greatly improved. Clicking any of the save buttons will now save without a page refresh. This is a much better experience, especially for Objects that have a lot of Metafields which require lots of page scrolling.


2. Sort Metafields
It's our goal to make it easier for developers and content creators to collaborate to build great products together. But, as happens sometimes in product development, we overestimated a content creator feature need. Such is the case for Metafield sorting. 

So the ability to sort Metafields has been removed from the editor role (but still available for developers and admin). BUT, if you do need to allow editors to sort Metafields, this can be added to the user's role in Your Bucket > Settings > Team. Use the "View as editor" switch on each page in the dashboard to see what this experience is like for your content creators.


3. New Revision added when Object is automatically published / unpublished
With scheduled publishing / unpublishing, you can automate when your Objects are available or removed from the API. Now when your Object has been automatically published or unpublished, a new revision will be created to indicate the date of the automatic event. This is good for record-keeping.


4. Give us feedback!
We've also added a quick input area to give us feedback. We would love to hear from you, so drop us a line! :)

We hope you enjoy these new features and updates. Any questions or comments? Reach out to us on Twitter and join the conversation on our Slack channel.

Gatsby Image support and Unpublish later


We're happy to announce the support of Gatsby Image in the Cosmic source plugin. The update enables you to utilize Gatsby’s native image processing capabilities to optimize image loading for your sites. In addition to that, we've also released a feature that allows content creators to unpublish content automatically at a later date and time.


1. Gatsby Image Plugin Support

What you need to know
There are no breaking changes, the Gatsby source plugin now has a next tag which you can use to test the new integration.
TL;DR
Get the new code
Download an example

The updates
Before this release, you didn't have the ability to use the awesome Gatsby Image plugin along with the Cosmic source plugin. But with this release, you now have the option to download selected media from Cosmic to save and cache locally. It will then use Gatsby’s native image processing capabilities with advanced image loading techniques to easily optimize image loading for your sites. 

You can install the plugin using  npm i gatsby-source-cosmicjs@next

Documentation is available here. You can also check our Gatsby Blog example here to look at the usage.

You can now do queries like this:

Note: It is in beta so your feedback is very important!


2. Unpublish Later

What you need to know
We had to simplify the layout of the publishing scheduler. If you were already using the publish later feature, you can see the video below to get an idea of what has changed.

The updates
We now provide the ability to unpublish your Objects at a specific day and time in the future. See the video below for details on how to set both scheduled "Publish" and "Unpublish" times. Minute increments have been changed from 15 minute to 5 minute increments to give you even more control of when your content is published and unpublished. To check this out, login and go to any Object in your Bucket. Then click the calendar icon connected to the "Publish" button.

We hope you enjoy these new features and updates. Any questions or comments? Reach out to us on Twitter and join the conversation on our Slack channel.

GraphQL API v2 Released 🎉


We're happy to announce the newest version of our GraphQL API. The new Cosmic GraphQL API v2 includes some great updates and improvements which you can read about below.


What you need to know
1. You can stay on v1, but updates and fixes will no longer be made to v1.
2. v2 includes mostly additions, but one breaking change to the getObjects  and getMedia  queries to enable pagination.


Playground
Demo for yourself in the playground. You can use the "Schema" and "Docs" right-side tabs to explore the Model and Queries.

View full page playground


Included in v2

1. Pagination support
You can now access the total and limit  properties from the API response. This gives you the ability to do pagination with the GraphQL API, which was previously not possible.

View full page playground


2. New Queries and Mutations
You can use the GraphQL API to get revisions from an Object as well as add new revisions without affecting the current published state of your Object.

getObjectRevisions
addObjectRevision


View full page playground


3. Deprecated Queries Removed
The following deprecated queries from v1 have been removed:
object
objects
objectsByType


4. Response Format Changes
To allow for the total and limit response, one breaking change had to be made. The response format for getObjects now follows the following format with all Objects moved into a second level objects.

View full page playground


And here's the old way for reference:

View full page playground


5. Search and Filter Options
One of the most loved new features in the REST API is filtering and searching by metadata. This is now available in the GraphQL API. For example, to get Objects that by a certain author. You can do this:

View full page playground


Read more about these updates in the GraphQL documentation. We hope you enjoy these new features with the latest version of the GraphQL API. Any questions or comments? Reach out to us on Twitter and join the conversation on our Slack channel.

Ready to Get Started?

No payment info required.
Start Now   Contact Sales