Documentation Center

Custom GraphQL Schemas

You can extend the out-of-the-box GraphQL query language by creating one or more custom GraphQL Schemas. Such Schemas must be written in the GraphQL SDL (Schema Definition Language).

Your custom schema takes the form of a file with extension .graphql which you store in the config\schemas\ directory of your (Session-enabled) Content Service. The (Session-enabled) Content Service scans this directory when it starts up and loads the file.

To work properly, your custom schemas must be written in valid GraphQL SDL (Schema Definition Language), and must not redefine pre-existing types.

To help you get started writing your own custom schema, use the sample provided. You can find the sample file, called cd.graphql.sample, in the config\schemas\ subfolder of the root folder of the installed Content Service or, if you installed the Session-enabled Content Service instead, on your installation media, in the folder Content Delivery\content\standalone\config\schemas\.

Copy the sample file and rename it to have a .graphql extension (for example, you could call it myextension.graphql). Modify the sample as needed, and save it in the config\schemas\ folder of your (Session-enabled) Content Service.