Skip to main content
In FrogBot the schema is controlled by your collections. Run the generate command to create the entire schema.

Schema generation script

Install @frogbotai/graphql as a dev dependency:
Run the following command to generate the schema:
The command finds your FrogBot config the same way frogbot generate:types does and writes schema.graphql to the directory you run it in. The schema contains a type for each of your collections, plus FrogBot’s public built-in collections and search queries. FrogBot’s internal collections aren’t included. To write the file somewhere else, set graphQL.schemaOutputFile in your FrogBot config. A relative path is resolved from the directory you run the command in:
Pass graphQL to buildConfig in your FrogBot config.

Custom Field Schemas

For array, block, group and named tab fields, you can generate top level reusable interfaces. The following group field config:
will generate:

Adding an npm script

FrogBot needs to be able to find your config to generate your GraphQL schema.
FrogBot looks for frogbot.config.{ts,js,mjs} in the current directory, its src folder, and each parent directory. If your config lives somewhere else, tell FrogBot where to find it with the FROGBOT_CONFIG_PATH environment variable. If this applies to you, create an npm script to make generating the schema easier:
Now you can run pnpm generate:graphQLSchema to easily generate your schema.