GraphQL data and files with access rules

Define a schema and query it right away. Per-schema and per-field rules decide who can read and write.

Schemas, rules and files in one service

GraphQL from your schema

Add a schema in the visual editor or as a JSON file and publish it. Blocks generates query, insert, insertMany, update, updateMany, delete and deleteMany, with where filters and AND/OR conditions.

Row- and column-level rules

Make a schema or a single field public, open to any signed-in user, or limited by rules on the user's ID, email, roles or permissions and the record's own fields.

Validation on every write

Attach regex, length, range and comparison checks to fields. Describe a pattern in plain language and Blocks writes the regex for you.

Files with folders, versions and sharing

Upload through pre-signed URLs, keep every version, move and copy files without duplicating the bytes, share with View, Download, Edit or Manage access, and restore from the trash.

Managed or your own MongoDB

Use the database Blocks runs for each environment, or point the project at your own MongoDB Atlas cluster.

Playground and data browser

Try queries with introspection in the Data Playground, and browse records as a table or JSON with filters and sorting.

Define it once, query it from your app

Keep schemas and rules in your repo as JSON, sync them with the CLI, and call them from your app with the SDK.

  1. Pull the schemas

    blocks data schema pull writes each schema to blocks/data/schemas as JSON, so changes go through code review.

  2. Sync and reload

    blocks data sync pushes schema and rule changes and reloads the gateway. Run it with --dry-run first to see the plan.

  3. Read and write from your app

    data.collection() gives you list, get, create, update and delete for a schema. Use data.graphql() for joins and custom query shapes.

# Keep schemas in git as JSON
blocks data schema pull --json

# Push schema and rule changes, then reload the gateway
blocks data sync --dry-run --json
blocks data sync --yes --json

# Upload a private file
blocks data files upload --file ./invoice.pdf --parent-id <directoryId> \
  --configuration-name Default --access-modifier Private --dry-run --json

Databases and storage

  • MongoDB Atlas
  • Azure Blob Storage
  • Amazon S3
  • S3-compatible (MinIO)
  • SFTP

Questions about Data

Which databases does Data support?

MongoDB. Each environment gets a database that Blocks runs, or you can connect your own MongoDB Atlas cluster with a connection URL and database name.

How do access rules work?

Each schema and each field has a policy: public, any signed-in user, or custom rules that compare the user's ID, email, roles or permissions with fields on the record. The gateway applies them to every query and mutation.

Where are files stored?

On Azure Blob Storage by default. You can add Amazon S3, S3-compatible storage such as MinIO, or an SFTP server as named storage configurations and choose one per upload.

Do schema changes need a redeploy?

No. Publish the schema in the console or run blocks data sync, and the gateway reloads with the new fields.

Start with a free project

Sign up at os.seliseblocks.com and create a project, or paste one prompt into Claude Code, Codex or Cursor and let your agent set it up through the Blocks CLI.