exp:expgraphqlschema
Print or write the GraphQL schema of a siteaccess: the schema language (sdl), the introspection result (json) or the classes and their fields (summary).
Script bin/php/expgraphqlschema.php, code in kernel/private/classes/commands/expgraphqlschema.php. Run it from the installation root, as the user the web server runs as:
./console exp:expgraphqlschema --help
./console exp:graphql:schema --help
php bin/php/expgraphqlschema.php --helpHelp text
Print the GraphQL schema of a siteaccess
sdl (the default): the schema language, for code generators and editors;
json: the introspection result ({ "data": { "__schema": ... } }), as a client reads it;
summary: the classes, their types and fields, the datatype of each field and whether it has a mapping.
The schema is printed whether or not the API is switched on (a schema for development).
./console exp:graphql:schema --siteaccess=site
./console exp:graphql:schema --format=json --output=schema.json
Exit code: 0 printed; 1 the file could not be written; 3 the library is missing; 2 wrong options.Options
| Option | Value | Help |
|---|---|---|
--format | required | sdl (the default), json or summary |
--output | required | write to this file instead of the screen |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expgraphqlschema.php, kernel/private/classes/commands/expgraphqlschema.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.