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:expgraphqlquery

Führt eine GraphQL-Abfrage auf der Konsole aus, als ein Benutzer der Installation (anonym, wenn --as keinen nennt), und gibt die Antwort aus.

Download as PDF

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

On this page

This page is a translation. Read the English original

exp:expgraphqlquery

Führt eine GraphQL-Abfrage auf der Konsole aus, als ein Benutzer der Installation (anonym, wenn --as keinen nennt), und gibt die Antwort aus.

Skript bin/php/expgraphqlquery.php, Code in kernel/private/classes/commands/expgraphqlquery.php. Führen Sie es im Wurzelverzeichnis der Installation aus, als der Benutzer, unter dem der Webserver läuft:

./console exp:expgraphqlquery --help
./console exp:graphql:query --help
php bin/php/expgraphqlquery.php --help

Hilfetext

Was --help ausgibt, so wie der Befehl es schreibt:

Run a GraphQL query and print the answer
The query is the argument, or a file of it (a path ending in .graphql or .gql, or - for standard
input). It runs in the siteaccess of --siteaccess with the rights of the user of --as (a login),
else as the anonymous user; the console may always read the schema (introspection). The API need
not be switched on.

./console exp:graphql:query '{ node(id: 2) { name children { totalCount } } }'
./console exp:graphql:query queries/menu.graphql --variables='{"depth": 2}' --as=admin
./console exp:graphql:query '{ siteaccess { name schemaHash } }' --format=table
./console exp:graphql:query --id=articles     a persisted query, by its name or its SHA-256

Exit code: 0 an answer without errors; 1 an answer with errors; 3 the library is missing;
2 wrong options (no query, variables not JSON, an unknown user).

Optionen

OptionWertHilfe
--variableserforderlichdie Variablen, ein JSON-Objekt
--operationerforderlichdie auszuführende Operation, wenn die Abfrage mehrere hat
--aserforderlichals dieser Benutzer ausführen (ein Login); Standard: anonym
--formaterforderlichjson (der Standard) oder table (eine Zeile je Wert: sein Pfad und der Wert)
--iderforderlichdie gespeicherte Abfrage mit diesem Namen oder SHA-256 ausführen statt eines Abfragetexts

Aus den Optionsdefinitionen im Code gelesen (startup(), getOptions(), options() oder ezcConsoleOption). Jedes Skript nimmt außerdem die Standardoptionen des Skript-Frameworks (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).

Argumente: [query].

Siehe auch


Erzeugt von ./console exp:help:examples --language=ger-de aus bin/php/expgraphqlquery.php, kernel/private/classes/commands/expgraphqlquery.php. Bearbeiten Sie diese Seite nicht: Ändern Sie die Quelle oder die deutsche Übersetzung und erzeugen Sie sie neu (wie). Freie Dokumentation: GFDL 1.3 oder später.

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