logo

Tembra

Easy integration

Simple API

arrow_back
  • Index
  • Common GraphQL info
  • GraphQL response format
  • CMS GraphQL
    • Article graphql
    • Text graphql
    • Page graphql
    • Key-value pairs graphql

GraphQL response format

Request example:

query {
    listTags {
        parentId
    }
}

Valid response example

{
    "data": {
        "listTags": [
            {
                "parentId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
            },
            {
                "parentId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
            }
        ]
    },
    "extensions": {
        "timestamp": "2025-09-25T19:19:03.614Z",
        "time": 0.081977
    }
}

The data variable contains the query or mutation response.

The extensions variable contains a timestamp representing the server time and a time representing request duration in seconds.

Invalid/error response example

{
    "errors": [
        {
            "message": "Space missing",
            "locations": [
                {
                    "line": 65,
                    "column": 5
                }
            ],
            "path": [
                "listTags"
            ],
            "extensions": {
                "code": "E_SPACE_MISSING"
            }
        }
    ],
    "data": null,
    "extensions": {
        "timestamp": "2025-09-25T19:26:28.593Z",
        "time": 0.00839
    }
}

The errors variable contains a list of errors. Usually, there is only one.

The extensions.code variable contains error code.

Error codes

{
		'E_UNAUTHORIZED': 'You are not authorized.',
		'E_UNAUTHENTICATED': 'You are not authenticated.',
		'E_SPACE_MISSING': 'Space missing.',
		'E_PROHIBITED': 'Prohibited action.',
		'E_REQUEST_TOO_LONG': 'Request is too long.',


		// ARTICLE
		'E_ARTICLE_UNKNOWN': 'Error in article module.',
		'E_ARTICLE_INTERNAL': 'Error in article module (internal).',
		'E_ARTICLE_TAG_DUPLICATE': 'Tag with this name already exists.',
		'E_ARTICLE_TAG_MISSING_PARENT': 'Tag cannot be created (missing parent).',
		'E_ARTICLE_TAG_MISSING_SPACE': 'Tag cannot be created (missing space).',
		'E_ARTICLE_TAG_MISSING_NAME': 'Tag cannot be created (missing name).',

		'E_ARTICLE_ARTICLE_DUPLICATE': 'Article with this name already exists.',
		'E_ARTICLE_ARTICLE_MISSING_PARENT': 'Article cannot be created (missing parent).',
		'E_ARTICLE_ARTICLE_MISSING_SPACE': 'Article cannot be created (missing space).',
		'E_ARTICLE_ARTICLE_MISSING_NAME': 'Article cannot be created (missing name).',
		'E_ARTICLE_ARTICLE_MISSING_TAG': 'Article tag does not exists.',

		'E_ARTICLE_VERSION_DUPLICATE': 'Duplicate article version.',
		'E_ARTICLE_VERSION_MISSING_ARTICLE': 'Article version cannot be created (missing article).',

		'E_ARTICLE_COMMENT_DUPLICATE': 'Duplicate article comment.',
		'E_ARTICLE_COMMENT_MISSING_PARENT': 'Article comment cannot be created (missing parent).',
		'E_ARTICLE_COMMENT_MISSING_ARTICLE': 'Article comment cannot be created (missing article).',
		'E_ARTICLE_COMMENT_MISSING_SPACE': 'Article comment cannot be created (missing space).',
		'E_ARTICLE_COMMENT_MISSING_USER': 'Article comment cannot be created (missing user).',
		'E_ARTICLE_COMMENT_INVALID_STATE': 'Article comment cannot be changed (wrong state).',


		// FILE
		'E_FILE_UNKNOWN': 'Error in file module.',
		'E_FILE_INTERNAL': 'Error in file module (internal).',
		'E_FILE_DUPLICATE': 'File with this name already exists.',
		'E_FILE_MISSING_PARENT': 'File cannot be created (missing parent).',
		'E_FILE_MISSING_SPACE': 'File cannot be created (missing space).',
		'E_FILE_MISSING_NAME': 'File cannot be created (missing name).',

		'E_FILE_FOLDER_DUPLICATE': 'Folder with this name already exists.',
		'E_FILE_FOLDER_MISSING_PARENT': 'Folder cannot be created (missing parent).',
		'E_FILE_FOLDER_MISSING_SPACE': 'Folder cannot be created (missing space).',
		'E_FILE_FOLDER_MISSING_NAME': 'Folder cannot be created (missing name).',
		'E_FILE_FOLDER_CANNOT_MOVE': 'Folder cannot be moved.',
		'E_FILE_FOLDER_CANNOT_DELETE': 'Folder cannot be deleted.',

		// KEY-VALUE
		'E_KEYVALUE_UNKNOWN': 'Error in key-value module.',
		'E_KEYVALUE_INTERNAL': 'Error in key-value module (internal).',
		'E_KEYVALUE_KEYVALUE_DUPLICATE': 'Key-value pair with this name already exists.',
		'E_KEYVALUE_KEYVALUE_MISSING_PARENT': 'Key-value pair cannot be created (missing parent).',
		'E_KEYVALUE_KEYVALUE_MISSING_SPACE': 'Key-value pair cannot be created (missing space).',
		'E_KEYVALUE_KEYVALUE_MISSING_NAME': 'Key-value pair cannot be created (missing name).',

		'E_KEYVALUE_VERSION_DUPLICATE': 'Duplicate key-value pair version.',
		'E_KEYVALUE_VERSION_MISSING_PARENT': 'Key-value pair version cannot be created (missing parent).',

		// ORGANIZATION

		'E_ORGANIZATION_UNKNOWN':  'Error in organization module.',
		'E_ORGANIZATION_INTERNAL': 'Error in organization module (internal).',
		'E_ORGANIZATION_DUPLICATE': 'Duplicate organization.',
		'E_ORGANIZATION_MISSING_PARENT': 'Organization cannot be created (missing parent).',
		'E_ORGANIZATION_MISSING_SPACE': 'Space does not exists.',
		'E_ORGANIZATION_MISSING_USER': 'User does not exists.',
		'E_ORGANIZATION_MISSING_NAME': 'Missing name.',


		// PAGE
		'E_PAGE_UNKNOWN': 'Error in page module.',
		'E_PAGE_INTERNAL': 'Error in page module (internal).',
		'E_PAGE_PAGE_DUPLICATE': 'Page with this name already exists.',
		'E_PAGE_PAGE_MISSING_PARENT': 'Page pair cannot be created (missing parent).',
		'E_PAGE_PAGE_MISSING_SPACE': 'Page cannot be created (missing space).',
		'E_PAGE_PAGE_MISSING_NAME': 'Page cannot be created (missing name).',

		'E_PAGE_VERSION_DUPLICATE': 'Duplicate page version.',
		'E_PAGE_VERSION_MISSING_PAGE': 'Page version cannot be created (missing page).',


		// SPACE
		'E_SPACE_UNKNOWN': 'Error in space module.',
		'E_SPACE_INTERNAL': 'Error in space module (internal).',
		'E_SPACE_DUPLICATE': 'Space with this name already exists.',
		'E_SPACE_MISSING_PARENT': 'Space cannot be created (missing parent).',
		'E_SPACE_MISSING_NAME': 'Space cannot be created (missing name).',
		'E_SPACE_INVALID_SETTINGS': 'Space settings data are not valid.',
		'E_SPACE_MISSING_USER': 'User does not exists.',



		// TEXT
		'E_TEXT_UNKNOWN': 'Error in text module.',
		'E_TEXT_INTERNAL': 'Error in text module (internal).',
		'E_TEXT_TEXT_DUPLICATE': 'Text with this name already exists.',
		'E_TEXT_TEXT_MISSING_PARENT': 'Text cannot be created (missing parent).',
		'E_TEXT_TEXT_MISSING_SPACE': 'Text cannot be created (missing space).',
		'E_TEXT_TEXT_MISSING_NAME': 'Text cannot be created (missing name).',
		'E_TEXT_TEXT_MISSING_CATEGORY': 'Category does not exists.',

		'E_TEXT_CATEGORY_DUPLICATE': 'Category with this name already exists.',
		'E_TEXT_CATEGORY_MISSING_PARENT': 'Category cannot be created (missing parent).',
		'E_TEXT_CATEGORY_MISSING_SPACE': 'Category cannot be created (missing space).',
		'E_TEXT_CATEGORY_MISSING_NAME': 'Category cannot be created (missing name).',

		'E_TEXT_VERSION_DUPLICATE': 'Duplicate text version.',
		'E_TEXT_VERSION_MISSING_TEXT': 'Text version cannot be created (missing text).',


		// USER
		'E_USER_UNKNOWN': 'Error in user module.',
		'E_USER_INTERNAL': 'Error in user module (internal).',
		'E_USER_DUPLICATE': 'User with this name already exists.',

		'E_USER_MISSING_LOGIN': 'Login is missing.',
		'E_USER_MISSING_PASSWORD': 'Password is missing.',
		'E_USER_PASSWORD_FORMAT': 'Wrong password format.',


		// USER PROFILE
		'E_USERPROFILE_UNKNOWN': 'Error in user profile module.',
		'E_USERPROFILE_INTERNAL': 'Error in user profile module (internal).',
		'E_USERPROFILE_MISSING_PARENT': 'User profile cannot be created (missing parent).',
		'E_USERPROFILE_MISSING_USER': 'User profile cannot be created (missing user).',


		// USER SETTINGS
		'E_USERSETTINGS_UNKNOWN': 'Error in user settings module.',
		'E_USERSETTINGS_INTERNAL': 'Error in user settings module (internal).',


	}				

Common GraphQL information

ISO Date time

Date and time information (createdAt etc.) is passed in a simplified ISO 8601-based format. See Date.prototype.toISOString() for more information.

Null parameter for listing and searching

If the parameter is nullable in the listing or search, the parameter is ignored if it is set to null. The exception is the "count" parameter, which defaults to 100 items.

@space directive

The "@space" directive in a call indicates that the "X-WNT-SPACE-ID" header must be set to the ID of the space you are working with. You can find the Space ID on the Space page in the application.

CMS GraphQL information

Language and country for listing and searching

Language and country parameters for listing and searching are:

# language / country parameter
input LanguageCountry {

	# language code
	language: String

	# country code
	country: String

}

# input for page versions listing
input PageVersionListInput {
	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean
}

An example of usage would be:

query {
	listKeyValues(data: {name: ["article"]}) {
		id
		name
		# parentId
		fullVersions(data: {
			languageCountry: [
				{language: "cs", country: "cz"},
				{language: "cs", country: ""},
				{ language: "cs" }
			]
		}) {
			pairs {
				name
				value
			}
		}
	}
}

The above example means, "Give me the cs language version for the cz country first." If that does not exist, look for the default cs language version (country: ""), and if that does not exist, give me any cs language version.

The listing/search looks for matching version in the order specified in languageCountry parameter.

If the languageCountryAll parameter is set to true, all versions in the list that exist are returned.

Published for listing and searching

If the published parameter for listing and searching is set to true, then the data must be set to published and the current date and time must be greater than or equal to the publishedFrom data. It must also be less than the publishedTo data, or the publishedTo data must not be set.

If the published parameter for listing and searching is set to false, the previous statement must not be true.

If published is not used or is set to null, the published parameters are ignored.

Versions vs fullVersions

Every basic representation of data (article, text, page, key-value pair) contains versions and fullVersions fields. The fullVersions field contains all version data, but the versions field is faster. Choose wisely.

Documentation

This documentation describes the public API for accessing data stored in Tembra.

Pages GraphQL

API endpoint: https://api.tembra.app/public/cms/graphql/page


########################################
# PAGES
########################################

# language / country parameter
input LanguageCountry {

	# language code
	language: String

	# country code
	country: String

}

# input for page versions listing
input PageVersionListInput {
	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# if true, listing will return only published versions
	# if false, listing will return only unpublished versions
	published: Boolean
}

# page representation
type Page {

	# Page.id
	id: String!

	# page name
	name: String!

	# Space.pageParentId
	parentId: String!

	# date and time when page was created
	createdAt: String!

	# date and time when page last updated
	updatedAt: String!

	# list of File.id
	files: [String!]!

	# whether page is published
	published: Boolean!

	# date and time since the page is published
	publishedFrom: String!

	# date and time until the page is published
	publishedTo: String

	# listing function for full page versions
	fullVersions(data: PageVersionListInput): [PageVersion!]!

	# listing function for versions information list
	versions: [PageVersionBase!]!
}

# input for page listing
input ListPagesInput {

	# pages names
	name: [String!]

	# listing offset
	start: Int

	# listing count
	count: Int

}

########################################
# VERSION
########################################

# basic information about page version
type PageVersionBase {

	# language code
	language: String!

	# country code
	country: String!

	# date and time when record was created
	createdAt: String!

	# date and time when record last updated
	updatedAt: String!

	# whether page version published parameters
	# are copied from parent page
	publishedAsParent: Boolean!

	# whether page version is published
	published: Boolean!

	# date and time since the page version is published
	publishedFrom: String!

	# date and time until the page version is published
	publishedTo: String

}

type PageVersion {

	# Page.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when page version was created
	createdAt: String!

	# date and time when page version last updated
	updatedAt: String!

	# page version title
	title: String!

	# page version URL
	url: String!

	# page version text
	text: String!

	# page version description
	description: String!

	# page version keywords
	keywords: String!

	# og:description tag
	ogDescription: String!

	# og:title tag
	ogTitle: String!

	# og:image tag
	ogImage: String!

	# whether page version published parameters
	# are copied from parent page
	publishedAsParent: Boolean!

	# whether page version is published
	published: Boolean!

	# date and time since the page version is published
	publishedFrom: String!

	# date and time until the page version is published
	publishedTo: String

}



########################################
# SCHEMA
########################################

type Query {
	# PING API
	ping: Boolean!

	# function to list pages
	listPages(data: ListPagesInput!): [Page!]! @emitCall(moduleName: "Page") @space

}

schema {
	query: Query
}

Key - values GraphQL

API endpoint: https://api.tembra.app/public/cms/graphql/keyValue


########################################
# KEYVALUE
########################################

# language / country parameter
input LanguageCountry {

	# language code
	language: String

	# country code
	country: String

}

# key-value pairs listing input data
input KeyValueVersionListInput {

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

}

# key-value pair representation
type KeyValue {

	# ID
	id: String!

	# name
	name: String!

	# (Space.keyValueParentId)
	parentId: String!

	# date and time when record was created
	createdAt: String!

	# date and time when record last updated
	updatedAt: String!

	# listing function for full key-value versions
	fullVersions(data: KeyValueVersionListInput): [KeyValueVersion!]!

	# listing function for versions information list
	versions: [KeyValueVersionBase!]!
}

# input for key-value listing
input ListKeyValuesInput {

	# list of names to list
	name: [String!]

	# listing offset
	start: Int

	# listing count
	count: Int

	# sort field (name)
	sort: String

	# sort direction (1 = ascending, -1 = descending)
	sortDirection: Int
}

########################################
# VERSION
########################################

# key-value pair data
type KeyValuePair {

	# key
	name: String!

	# value
	value: String!

}

# basic information of version
type KeyValueVersionBase {

	# language code
	language: String!

	# country code
	country: String!

	# date and time when record was created
	createdAt: String!

	# date and time when record last updated
	updatedAt: String!

}


type KeyValueVersion {

	# KeyValue.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when record was created
	createdAt: String!

	# date and time when record last updated
	updatedAt: String!

	# list of key-value pairs
	pairs: [KeyValuePair!]!

}


########################################
# SCHEMA
########################################

type Query {

	# ping API
	ping: Boolean!

	# list key-values
	listKeyValues(data: ListKeyValuesInput!): [KeyValue!]! @emitCall(moduleName: "KeyValue") @space

}

schema {
	query: Query
}

Article GraphQL

API endpoint: https://api.tembra.app/public/cms/graphql/article


########################################
# TAGS
########################################

# language / country version of tag
type TagContent {

	# language code
	language: String!

	# country code
	country: String!

	# translation
	data: String!

}

#tag
type Tag {

	# tag ID
	id: String!

	# tag name
	name: String!

	# tag parent (either Space.articleParentId or Tag.id)
	parentId: String!

	# list of traslations
	content: [TagContent!]!

}

########################################
# ARTICLES
########################################

# language / country parameter
input LanguageCountry {

	# language code
	language: String

	# country code
	country: String

}

# input for article versions listing
input ArticleVersionListInput {

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# if true, listing will return only published versions
	# if false, listing will return only unpublished versions
	published: Boolean

}

# representation of Article
type Article {

	# article ID
	id: String!

	# article name
	name: String!

	# article parent id (Space.articleParentId)
	parentId: String!

	# date and time when article was created
	createdAt: String!

	# date and time when article last updated
	updatedAt: String!

	# list of Tag.id
	tags: [String!]!

	# list of File.id
	files: [String!]!

	# whether article is published
	published: Boolean!

	# date and time since the article is published
	publishedFrom: String!

	# date and time until the article is published
	publishedTo: String

	# listing function for full article versions
	fullVersions(data: ArticleVersionListInput): [ArticleVersion!]!

	# listing function for versions information list
	versions: [ArticleVersionBase!]!

}

# input for article listing
input ListArticlesInput {

	# whether article is published
	# published, publishedFrom and publishedTo are taken into account
	published: Boolean

	# listing offset
	start: Int

	# listing count
	count: Int

	# sort field (name | published)
	sort: String

	# sort direction (1 = ascending, -1 = descending)
	sortDirection: Int

	# list of Tag.id to filter by
	tags: [String!]

}

########################################
# VERSION
########################################

# basic information about article version
type ArticleVersionBase {

	# language code
	language: String!

	# country code
	country: String!

	# date and time when article version was created
	createdAt: String!

	# date and time when article version last updated
	updatedAt: String!


	# whether article version published parameters
	# are copied from parent article
	publishedAsParent: Boolean!

	# whether article version is published
	published: Boolean!

	# date and time since the article version is published
	publishedFrom: String!

	# date and time until the article version is published
	publishedTo: String

}

# full article version
type ArticleVersion {

	# Article.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when article version was created
	createdAt: String!

	# date and time when article version last updated
	updatedAt: String!

	# article version title
	title: String!

	# article version URL
	url: String!

	# article version perex
	perex: String!

	# article version text
	text: String!

	# article version description
	description: String!

	# article version keywords
	keywords: String!

	# og:description tag
	ogDescription: String!

	# og:title tag
	ogTitle: String!

	# og:image tag
	ogImage: String!

	# perex image URL
	perexImage: String!

	# whether article version published parameters
	# are copied from parent article
	publishedAsParent: Boolean!

	# whether article version is published
	published: Boolean!

	# date and time since the article version is published
	publishedFrom: String!

	# date and time until the article version is published
	publishedTo: String

}


########################################
# PEREX
########################################

# localized version of tag
type ArticlePerexTag {

	# Tag.id
	id: String!

	# localized version
	data: String!

}

# article perex
type ArticlePerex {

	# Article.parentId
	articleParentId: String!

	# Article.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when article version was created
	createdAt: String!

	# date and time when article version last updated
	updatedAt: String!


	# whether article version published parameters
	# are copied from parent article
	publishedAsParent: Boolean!

	# whether article version is published
	published: Boolean!

	# date and time since the article version is published
	publishedFrom: String!

	# date and time until the article version is published
	publishedTo: String

	# article version title
	title: String!

	# article version URL
	url: String!

	# article version perex
	perex: String!

	# perex image URL
	perexImage: String!

	# list of localized tags with ID
	tags: [ArticlePerexTag!]!

}

# input for function to get number of perexes
input CountArticlePerexesInput {

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# if true, listing will return only published versions
	# if false, listing will return only unpublished versions
	published: Boolean

	# list of tags to filter by (id or localized name)
	tags: [String]

}

# input for function to list perexes
input ListArticlePerexesInput {

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# if true, listing will return only published versions
	# if false, listing will return only unpublished versions
	published: Boolean

	# list of tags to filter by (id or localized name)
	tags: [String]

	# listing offset
	start: Int

	# listing count
	count: Int

}


########################################
# COMMENT
########################################

# custom comment field
type CommentField {

	# custom field name
	name: String!

	# custom field value
	value: String!

}

# comment
type Comment {

	# Comment.id
	id: String!

	# Space.id
	spaceId: String!

	# article.id
	articleId: String!

	# parent Comment.id (this is a response)
	parentId: String

	# User.id
	userId: String

	# numeric representation of comemnts tree structure
	# 00000008.00000015.00000002 would represent second answer to 15th answer to 8th comment
	levelIdent: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when comment version was created
	createdAt: String!

	# date and time when comment version last updated
	updatedAt: String!

	# comment state
	# "new" | "valid" | "junk"
	state: String!

	# comment's subject
	subject: String!

	# comment's text
	text: String!

	# comment's additional fields
	fields: [CommentField!]

}

# custom comment field
input CommentFieldInput {

	# custom field name
	name: String!

	# custom field value
	value: String!

}

# create comment input data
input CreateCommentInput {

	# Article.id
	articleId: String!

	# Comment.id
	parentId: String

	# language code
	language: String!

	# country code
	country: String!

	# comment's subject
	subject: String!

	# comment's text
	text: String!

	# comment's additional fields
	fields: [CommentFieldInput!]!

}

# list comments input data
input ListCommentsInput {

	# Article.id
	articleId: String!

	# Comment.id
	parentId: String

	# language code
	language: String

	# country code
	country: String

	# whether to include answers as well (all levels)
	includeChildren: Boolean

	# comment state
	# "new" | "valid" | "junk"
	state: [String!]

	# listing offset
	start: Int

	# listing count
	count: Int

}

# get the number of article versions based on search
input CountSearchArticleVersionsInput {

	# text to search
	search: String!

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# whether article is published
	# published, publishedFrom and publishedTo are taken into account
	published: Boolean

}

# list article versions based on search
input SearchArticleVersionsInput {

	# text to search
	search: String!

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# whether article is published
	# published, publishedFrom and publishedTo are taken into account
	published: Boolean

	# listing offset
	start: Int

	# listing count
	count: Int

}

# result of article version listing
type SearchArticleVersionsResult {

	# Article.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# article version description
	description: String!

	# article version title
	title: String!

	# article version URL
	url: String!

	# whether article version is published
	# publishedAsParent, published, publishedFrom and publishedTo are taken into account
	published: Boolean!

	# numeric score of search, higher is better
	searchScore: Float!

}

# get the number of article perexes based on search
input CountSearchArticlePerexesInput {

	# text to search
	search: String!

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# whether article is published
	# published, publishedFrom and publishedTo are taken into account
	published: Boolean

}

# list article perexes based on search
input SearchArticlePerexesInput {

	# text to search
	search: String!

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

	# whether article is published
	# published, publishedFrom and publishedTo are taken into account
	published: Boolean

	# listing offset
	start: Int

	# listing count
	count: Int

}

type SearchArticlePerexesResult {

	# Article.parentId
	articleParentId: String!

	# Article.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when article version was created
	createdAt: String!

	# date and time when article version last updated
	updatedAt: String!

	# whether article version published parameters
	# are copied from parent article
	publishedAsParent: Boolean!

	# whether article version is published
	published: Boolean!

	# date and time since the article version is published
	publishedFrom: String!

	# date and time until the article version is published
	publishedTo: String

	# article version title
	title: String!

	# article version URL
	url: String!

	# article version perex
	perex: String!

	# perex image URL
	perexImage: String!

	# list of localized tags with ID
	tags: [ArticlePerexTag!]!

	# numeric score of search, higher is better
	searchScore: Float!
}



########################################
# SCHEMA
########################################

type Query {

	# PING API
	ping: Boolean!

	# get article by ID
	getArticle(id: String!): Article @emitCall(moduleName: "Article") @space

	# list articles
	listArticles(data: ListArticlesInput!): [Article!]! @emitCall(moduleName: "Article") @space

	# get the number of article perexes
	countArticlePerexes(data: CountArticlePerexesInput!): Int! @emitCall(moduleName: "Article") @space

	# list article perexes
	listArticlePerexes(data: ListArticlePerexesInput!): [ArticlePerex!]! @emitCall(moduleName: "Article") @space

	# list tags
	listTags: [Tag!]! @emitCall(moduleName: "Article") @space

	# list article comments
	listComments(data: ListCommentsInput!): [Comment!]! @emitCall(moduleName: "Article") @space

	# get the number of article versions based on search
	countSearchArticleVersions(data: CountSearchArticleVersionsInput): Int! @emitCall(moduleName: "Article") @space

	# list article versions based on search
	searchArticleVersions(data: SearchArticleVersionsInput): [SearchArticleVersionsResult!]! @emitCall(moduleName: "Article") @space

	# get the number of article perexes based on search
	countSearchArticlePerexes(data: CountSearchArticlePerexesInput): Int! @emitCall(moduleName: "Article") @space

	# list article perexes based on search
	searchArticlePerexes(data: SearchArticlePerexesInput): [SearchArticlePerexesResult!]! @emitCall(moduleName: "Article") @space

}

type Mutation {

	# create article comment
	createComment(data: CreateCommentInput!): String! @emitCall(moduleName: "Article") @space

}

schema {
	query: Query
	mutation: Mutation
}

Text GraphQL

API endpoint: https://api.tembra.app/public/cms/graphql/text


########################################
# TEXT
########################################

# language / country parameter
input LanguageCountry {

	# language code
	language: String

	# country code
	country: String

}


# input for article versions listing
input TextVersionListInput {

	# language / country filters for listing
	languageCountry: [LanguageCountry!]

	# if true, listing will return all versions in languageCountry parameter
	# if false, listing will return only first found version for languageCountry parameter
	languageCountryAll: Boolean

}

type Text {

	# Text.id
	id: String!

	# text name
	name: String!

	# text parent id (Space.textParentId)
	parentId: String!

	# date and time when text was created
	createdAt: String!

	# date and time when text last updated
	updatedAt: String!

	# list of File.id
	files: [String!]!

	# category ID
	categoryId: String!

	# listing function for full text versions
	fullVersions(data: TextVersionListInput): [TextVersion!]!

	# listing function for versions information list
	versions: [TextVersionBase!]!
}

# input for text listing
input ListTextsInput {

	# list of text names to list
	name: [String!]

	# list of category IDs to list texts from
	categoryId: [String!]

	# list of category names to list texts from
	categoryName: [String!]

	# listing offset
	start: Int

	# listing count
	count: Int

	# sort field (name)
	sort: String

	# sort direction (1 = ascending, -1 = descending)
	sortDirection: Int

}

########################################
# VERSION
########################################

# basic information about text version
type TextVersionBase {

	# language code
	language: String!

	# country code
	country: String!

	# date and time when article version was created
	createdAt: String!

	# date and time when article version last updated
	updatedAt: String!

}

# Text version representation
type TextVersion {

	# Text.id
	parentId: String!

	# language code
	language: String!

	# country code
	country: String!

	# date and time when article version was created
	createdAt: String!

	# date and time when article version last updated
	updatedAt: String!

	# text title
	title: String!

	#text data
	text: String!

}


########################################
# SCHEMA
########################################

type Query {

	# PING API
	ping: Boolean!

	# function to list texts
	listTexts(data: ListTextsInput!): [Text!]! @emitCall(moduleName: "Text") @space
}


schema {
	query: Query
}