Skip to the content
Documentation

exp:expgraphqldisable

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

Switch the GraphQL API, or only its mutations, off for every siteaccess or for some; a dry run unless --apply

Usage

./console exp:expgraphqldisable [options]
php bin/php/expgraphqldisable.php [options]
./console exp:graphql:disable [options]

Aliases

exp:graphql:disable

Help

The output of ./console help exp:expgraphqldisable (the script run with --help), without the standard options:

Usage: bin/php/expgraphqldisable.php [OPTION]...
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:
  --mutations  switch only the mutations off (they are on by default): a read-only API
  --apply      write; without it nothing is changed

Options

Option Value Description
--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

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/expgraphqldisable.php, kernel/private/classes/commands/expgraphqldisable.php

See also

Generated example: exp:expgraphqldisable

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.