exp:expgraphqlstarter
Generate a starter front end (Next.js, Nuxt, Astro, plain HTML or Expo) that reads the site through the GraphQL API, with queries from the live schema; a dry run unless --apply.
Script bin/php/expgraphqlstarter.php, code in kernel/private/classes/commands/expgraphqlstarter.php. Run it from the installation root, as the user the web server runs as:
./console exp:expgraphqlstarter --help
./console exp:graphql:starter --help
php bin/php/expgraphqlstarter.php --helpHelp text
Generate a starter front end for the GraphQL API
Writes a project into a new directory: the kit's files (shipped in share/graphql/starters/) with the
end point filled in, and queries generated from the schema of the siteaccess: the menu, a page by its
URL alias, and one query per content class with every field of the class, as a module of the kit and
as .graphql files for exp:graphql:persist. Every generated query is checked against the schema and its
limits first. Nothing is installed or deployed: run npm in the directory. Lists the files and writes
nothing without --apply.Options
| Option | Value | Help |
|---|---|---|
--kit | required | the kit: html, next, nuxt, astro or expo |
--to | required | the directory to write the project to (new or empty) |
--endpoint | required | the address of the end point (default: site.ini [SiteSettings] SiteURL and /api/graphql) |
--list | list the kits | |
--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/expgraphqlstarter.php, kernel/private/classes/commands/expgraphqlstarter.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.