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.

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.

Customize REST API Response, Object Metafields Search


We've got a couple updates to make editing and integrating your Cosmic-powered content faster and easier.

1. Customize API Response Data
You can now add a query parameter (props) to the REST API (or NPM module) to limit the response data to only selected properties. Think of this like GraphQL-ifying your REST response to get only the data you need.

For example here's the old way to get Objects from the REST API which gives you everything:

https://api.cosmicjs.com/v1/simple-react-blog/objects?pretty=true&hide_metafields=true&type=posts&limit=20

And now the same query with added props query parameter.

https://api.cosmicjs.com/v1/simple-react-blog/objects?pretty=true&hide_metafields=true&type=posts&limit=20&props=slug,title,content

As you can see, adding props to your query makes your response much more concise giving you only the data you need. This should make your API responses faster, giving you and your end users a better experience 😎

Note: You can also add metadata.your_key to get selected metadata values (limited to one level only).

We've also updated the "Developer Tools" modal in the Dashboard to check out what this looks like:


UPDATE: 9/10/2019
You can also limit the depth of your response data by adding the query param depth. This will limit the nested depth of Object Metafields.

Check out the updated REST API docs for more info.


2. Search Objects in Object Metafields
One of our most popular features is the ability to connect Objects to each other to create relationships. For example: Blog Posts may need to connect to Categories and Authors which you can accomplish using Object Relationship Metafields.

It's now much easier to find the Object you're looking for with a new search feature on the Object Select modal. Simply type in a keyword to quickly find the Objects you need. Gif below:

Updates to Scheduled Publishing


We have a quick update to scheduled publishing that should make things easier for those using this handy feature.

How scheduled publishing used to work:

You set your scheduled publish day and time and it sets your content to draft. This was fine for new content, but not ideal for already published content. If you wanted to maintain your published content and save a new draft for later scheduled update this didn't work.

The new way:
You can now save a published version AND save a draft version scheduled for later publish. This also makes it possible to keep two versions running: 1) Your published content and 2) your draft content scheduled for publish later.

I hope you like this update to scheduled publishing. This update was shipped in direct response to a user that needed a better experience with this feature.

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.