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

Schaltet die GraphQL-API mit einem Befehl ein: die Siteaccesses, die Mutationen, CORS für ein Frontend, ein API-Schlüssel, das Schema, ein curl-Beispiel; ein Probelauf ohne --apply.

Download as PDF

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

On this page

This page is a translation. Read the English original

exp:expgraphqlenable

Schaltet die GraphQL-API mit einem Befehl ein: die Siteaccesses, die Mutationen, CORS für ein Frontend, ein API-Schlüssel, das Schema, ein curl-Beispiel; ein Probelauf ohne --apply.

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

./console exp:expgraphqlenable --help
./console exp:graphql:enable --help
php bin/php/expgraphqlenable.php --help

Hilfetext

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

Switch the GraphQL API on
Sets graphql.ini [GraphQLSettings] Enabled=enabled in settings/override, adds the siteaccesses of
--siteaccess to SiteAccessList[] (without it the API answers in every siteaccess); the mutations
come on with it (MutationsEnabled=enabled, the default), and --mutations writes that too, where
exp:graphql:disable --mutations switched them off. Lets a front end's origin call it with
--origin (rest.ini [CorsSettings]), makes a personal API key for a user with --key-for (the token
is shown once), checks that the schema builds, and prints the end point, a curl example and the
playground. Shows the changes as a diff and writes nothing without --apply; with --apply each file
is backed up first and the INI caches are cleared.

./console exp:graphql:enable                                        what would change
./console exp:graphql:enable --siteaccess=site --apply
./console exp:graphql:enable --siteaccess=site --origin=https://shop.example.com --key-for=frontend --apply
./console exp:graphql:enable --siteaccess=site --mutations --key-for=editor --apply

Exit code: 0 done (or shown); 1 a file could not be written, or the key not made; 3 the library is
missing; 2 wrong options (an unknown siteaccess or user, an origin that is not one).

Optionen

OptionWertHilfe
--siteaccesserforderlichdie Siteaccesses, in denen sie antwortet, durch Kommas getrennt (Standard: jeder Siteaccess)
--originerforderlichder Origin eines Frontends, das sie aus einem Browser aufrufen darf (CORS), durch Kommas getrennt
--mutationsdie Mutationen wieder einschalten (in den Siteaccesses aus --siteaccess); sie sind standardmäßig eingeschaltet
--key-forerforderlicheinen persönlichen API-Schlüssel für diesen Benutzer erzeugen (ein Login)
--key-nameerforderlichder Name des Schlüssels (Standard: GraphQL front end)
--scopeerforderlichdie Bereiche des Schlüssels: graphql:read (der Standard), graphql:write (der Standard mit --mutations)
--dayserforderlichdie Lebensdauer des Schlüssels in Tagen (rest.ini [ApiKeySettings] ExpiryChoices[]; Standard 90)
--applyschreiben; ohne diese Option wird nichts geändert

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

Siehe auch


Erzeugt von ./console exp:help:examples --language=ger-de aus bin/php/expgraphqlenable.php, kernel/private/classes/commands/expgraphqlenable.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