Skip to content

Playground file structure

Moritz Lang edited this page Nov 24, 2018 · 7 revisions

.ocelotplayground πŸ“¦

The main files you work with are called Playgrounds. A Playground is a package file, which basically means that it is a folder presented as if it were a single file. This has the benefit that we can deliver both contents and settings in one, human-readable, bundle. In detail this will look as follows:

Example.ocelotplayground
contents.graphql settings.json

contents.graphql πŸ“„

This file is a normal GraphQL file which can easily be used outside the containing Playground. It contains the actual contents the user enters within the editor.

settings.json πŸ“„

As its name suggests this file is used to store the Playground's settings. The following snippet shows the default settings.json.

{
  "endpoint": null
}

You may add any of these optional fields:

Field Type Description
additional_headers Object Additional HTTP headers
(Content-Type & Accept are already provided by the app)

Authentication

Almost every API requires some sort of authentication. We recommend that you don't add authentication headers to the additional_headers field as their values would be stored as plain text inside settings.json. Use Ocelots accounts feature instead, which will be explained on a separate Wiki page.

Clone this wiki locally