Cosmic Changelog

We release news about product enhancements and new features serveral times a month. Follow us on Twitter   to keep up with the latest product news.

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 JS 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 JS source plugin. But with this release, you now have the option to download selected media from Cosmic JS 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.

Auto Save, Object Revisions Endpoint, and Metafield Bug Fixes


We've got some exciting updates that should make editing and integrating your Cosmic-powered content faster, easier, and more enjoyable. This release includes two updates: 1) a new Auto Save feature, and 2) fixes and enhancements to the Metafield editing experience.


1. Auto Save
We have added a new Auto Save feature, which will automatically save your Object content to draft while you are editing. No need to manually save until you are ready to publish. (This is currently only available if you have revision history enabled)


Customers of Gatsby Preview will love this feature as you will see updates to your Gatsby Cloud link instantaneously!

Auto Save with Gatsby Cloud in action:

click to zoom

2. Object Revisions Endpoint
You now have revisions available via the API. You can find this endpoint on every Object in the Dashboard when you click the "Revisions" button. View the docs for more info.

click to zoom

3. Metafields (Bug fixes and enhancements)
The Cosmic JS team is dedicated to offering a first-class content editing experience.  With our Metafields content modeling approach, we offer one of the most powerful content management systems available. And we've made this much-loved feature even better.

We're happy to report that we fixed some Metafield bugs reported by the Cosmic JS community as well as added a few enhancements.

Fixes include:

  • Help Text
    • Issues related to repeater & parents have been fixed
  • Select Dropdown
    • A bug with dropdown `key` & `value` issues has been fixed
  • Repeater scroll Issue
    • Edit Page no longer jumps up and down when you add and remove repeater items

Enhancements include:

  • Duplicate Metafield
    • Now when you duplicate Metafields, it will append a unique `key` identifier
  • Unique Metafield keys
    • Metafield keys are now required to be unique. This fixes quite a few issues that came up from Metafields clashing or not showing up in the API


Any questions or comments? Reach out to us on Twitter and join the conversation on our Slack channel.

Infrastructure Upgrade, New Metafields, and more


This changelog announcement is a big one for us and includes:

  1. Upgraded infrastructure
  2. New Metafields and
  3. Optimizations to our open source clients.


1. Infrastructure Upgrade

We're happy to tell you that all Cosmic JS components are now powered 100% by serverless technologies. By running completely even-driven using AWS Lambda functions, the REST API, GraphQL API, Dashboard application, and the website are now infinitely scalable through high traffic loads.

This is huge, because it means you can depend on us to deliver your content through the highest traffic loads with dynamic server capacity on demand. This is also big for the Cosmic JS team, because we are now able to make product improvements at a higher velocity with a more streamlined deployment process.

We have also added a caching service to our website to serve our website resources at the edge. Your team can now get to any resource on cosmicjs.com faster and easier with at least 10x faster page loading from any spot on the globe.



2. New Metafields

We have added Boolean Switch and Number Metafields to our list of available Metafield types. We recommend that if you are using Text Metafields for either of these value types, that you switch to these new Metafields.

New Switch Metafield in action:



3. Open Source Optimizations

We've added additional optimizations to our popular Cosmic JS NPM module and Gatsby source plugin. By adding the Accept-Encoding: gzip header to encode responses, API load times and payload sizes have been cut in half. Install the latest versions of these libraries to get this improvement (3.2.35 and 1.0.4 respectively).


We're on a mission to build the best CMS on the planet, and your feedback helps! If you have any questions or feature requests, reach out to us on Twitter, and join our Slack channel. Happy building!

Filters and Smart Views


We're excited to release a new feature that should be a huge time-saver for finding and using your Bucket content: Filters and Smart Views. You can now filter and save smart views in your Objects table view in the Dashboard.

Filter and Save Smart View

Check it out by logging in and going to any Object Type in your Bucket. 


Filters
Click the "Filters" button on any Object Type table view in the Dashboard. Filter Objects by:

  • Status
  • Created by
  • Metadata


Smart views
You can then save your filtered content into "Smart Views" that will be added to the sidebar of your Bucket dashboard for easy access. Save for just yourself, or for your whole team.


API Filtering
After filtering, click the "Developer Tools" button to then get the API REST request and NPM module code for your filter options. Metadata filters are available in the latest NPM module v3.2.31. Read more about all NPM and API options in the Cosmic jS docs.

It looks like this:

I hope you enjoy the new capabilities. This feature comes as a direct response to users that needed a better way to find and filter content.

If you have any questions or update that you would like to see shipped, please reach out to us on Twitter and join the conversation on Slack.

Ready to Get Started?

No payment info required.
Start Now   Contact Sales