graphql_export
GraphQL Export
GraphQL Export enables exporting your GraphQL schemas and introspection data to files.
An example usage: You have Drupal and a detached frontend in a monorepo. You can use this module to export the full schema to the frontend application on config export for usage by frontend tooling.
This module enables:
Web UI
This module will expose a simple interface at /admin/config/graphql/servers/manage/SERVER_MACHINE_ID_HERE/export where you can see and manually export the schema.
Exporting with Drush
To enable drush exporting, optionally add the following to your settings.php:
$settings['graphql_export'] = [
'SERVER_MACHINE_ID_HERE' => [
'graphqls' => '../path/to/save/schema.graphqls',
'json' => '../path/to/save/schema.json',
],
];
Run drush config:export to export your files.
You can change the file paths to whatever you like, as long as the path is writable by Drupal when exporting your config.
GraphQL 3.x support
Use the 8.x-1x branch. This version is not actively maintained. It only has drush integration, and there is slight differences in the settings required. View branch README for more info.