exp:expgraphqldisable
Switch the GraphQL API, or only its mutations, off for every siteaccess or for some; a dry run unless --apply.
Script bin/php/expgraphqldisable.php, code in kernel/private/classes/commands/expgraphqldisable.php. Run it from the installation root, as the user the web server runs as:
./console exp:expgraphqldisable --help
./console exp:graphql:disable --help
php bin/php/expgraphqldisable.php --helpHelp text
Switch the GraphQL API off
Sets graphql.ini [GraphQLSettings] Enabled=disabled in settings/override (every siteaccess), or takes
the siteaccesses of --siteaccess out of SiteAccessList[] there (settings/override wins over the files
of a siteaccess; a list that would become empty switches the API off). With --mutations only the
mutations are switched off (MutationsEnabled=disabled; enabled is the default, together with the
API) and the queries keep answering: a read-only API. /api/graphql
then answers 404 (DISABLED); the persisted queries, the keys and the cache stay.
Shows the changes as a diff and writes nothing without --apply.
./console exp:graphql:disable what would change
./console exp:graphql:disable --apply
./console exp:graphql:disable --siteaccess=site --mutations --apply
Exit code: 0 done (or shown); 1 a file could not be written; 2 wrong options (an unknown siteaccess).Options
| Option | Value | Help |
|---|---|---|
--siteaccess | required | only these siteaccesses, comma separated (default: every siteaccess) |
--mutations | switch only the mutations off (they are on by default): a read-only API | |
--apply | write; without it nothing is changed |
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/expgraphqldisable.php, kernel/private/classes/commands/expgraphqldisable.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.