NotionQL allows you to query for database properties and blocks on pages in your Notion Workspace. You will be able to query any databases within the pages you allow NotionQL to access when connecting your Notion Workspace.
Currently the GraphQL endpoint only supports querying your Notion Workspace but support for mutations is coming soon.
NotionQL generates two GraphQL queries for each Notion Database.
- A singular, camel-cased query that finds a specific page in the database. The query uses the same name as the database's title and takes in the page ID. If the schema's title is a plural noun, NotionQL attempts to use its singular form.
- A plural, camel-cased query that returns all pages in the database. If possible, the query uses the plural form of the singular query name.
Each field (database title and properties) undergo the following sanitization:
- Camel-casing and deburr-ing
- Removing special characters
- Adding an underscore for fields that start with a number
Simple Field Name
Golden State Warriors → goldenStateWarriors
Fields with Diacritical Marks
Golden Ståte Wårriors → goldenStateWarriors
Fields with Special Characters
Golden State Warriors 😀 → goldenStateWarriors
Fields with Leading Numbers
69 Golden State Warriors → _69GoldenStateWarriors
Fields with Only Special Charactes
😀😀😀😀😀 → _
The Notion API currently only supports text-like blocks, limiting what types of blocks NotionQL can return. Currently, NotionQL supports the following block types:
Blocks include a markdown field which automatically converts the Rich Text Object into markdown.
There are a few weird edge cases:
- Annotations like bold or strikethrough will only apply on the text and not leading or trailing whitespace. For example, This statement ~~doesn't exist~~ in the middle → This statement ~~doesn't exist~~ in the middle.
- Annotations applied to whitespace will be ignored. This differs than Notion's markdown exporter. For example, exporting This → ← is italic would export This → ← is italic from NotionQL but This →**← is italic in Notion.