Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expgraphqlpersist

Store GraphQL queries on the server as persisted queries (called by name or SHA-256), list them or remove them; a dry run unless --apply.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/expgraphqlpersist.md

On this page

exp:expgraphqlpersist

Store GraphQL queries on the server as persisted queries (called by name or SHA-256), list them or remove them; a dry run unless --apply.

Script bin/php/expgraphqlpersist.php, code in kernel/private/classes/commands/expgraphqlpersist.php. Run it from the installation root, as the user the web server runs as:

./console exp:expgraphqlpersist --help
./console exp:graphql:persist --help
php bin/php/expgraphqlpersist.php --help

Help text

Store GraphQL queries on the server as persisted queries
Each .graphql file (a file, or every .graphql file of a directory) is checked against the schema of
the siteaccess and stored under its SHA-256 and its file name without .graphql (its name). A client
then runs it by name (GET /api/graphql?id=articles) or by hash (Apollo's persisted queries), and only
persisted queries are cached (graphql.ini ResponseCache). Nothing is written without --apply.

./console exp:graphql:persist queries/                  check every .graphql file, store nothing
./console exp:graphql:persist queries/ --apply          store them
./console exp:graphql:persist menu.graphql --name=main-menu --apply
./console exp:graphql:persist --list [--format=json]
./console exp:graphql:persist --remove=main-menu --apply

Exit code: 0 fine; 1 a query does not fit the schema (nothing is stored then); 3 the library is
missing; 2 wrong options.

Options

OptionValueHelp
--namerequiredthe name of the query (one file only); default: the file name without .graphql
--listlist the persisted queries
--removerequiredremove the persisted query of this name or SHA-256 (and its names)
--applywrite; without it nothing is changed
--formatrequiredtext (the default) or json (with --list)

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 ...).

Arguments: [path].


Generated by ./console exp:help:examples from bin/php/expgraphqlpersist.php, kernel/private/classes/commands/expgraphqlpersist.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x