Skip to content

Instantly share code, notes, and snippets.

@mornir
Forked from bjoerge/recover-schema.md
Created November 13, 2019 13:49
Show Gist options
  • Save mornir/497390a24290240e01e2f5fc3b33e9e2 to your computer and use it in GitHub Desktop.
Save mornir/497390a24290240e01e2f5fc3b33e9e2 to your computer and use it in GitHub Desktop.
How to recover lost schema from *.sanity.studio.md

First, go to https://.sanity.studio, and open the developer console (usually by one of the keyboard shortcuts Command+Option+I, F12 or Control+Shift+I depending on what browser/platform you are using)

Steps

  1. Open the Sources tab
  2. Find the app.bundle.js file in the sidebar tree view.
  3. Hit the pretty print source button
  4. Locate your schema types by searching (e.g. try searching for one of your custom types) it in the source view.

You should be able to recover most of your schema type definitions this way, although you may need to reformat and rewrite from the minified code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment