{"id":25978390,"url":"https://github.com/technway/graphql-starter","last_synced_at":"2025-03-05T05:20:14.187Z","repository":{"id":272666616,"uuid":"917371242","full_name":"technway/graphql-starter","owner":"technway","description":"A lightweight headless WordPress theme optimized for GraphQL.","archived":false,"fork":false,"pushed_at":"2025-02-03T05:30:03.000Z","size":109,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-05T02:07:28.422Z","etag":null,"topics":["graphql-api","headless-wordpress","starter-theme","wordpress-theme","wpgraphql"],"latest_commit_sha":null,"homepage":"https://technway.github.io/graphql-starter/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-15T21:18:46.000Z","updated_at":"2025-02-03T05:26:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff04750a-bf90-4822-b5e2-17757efc0440","html_url":"https://github.com/technway/graphql-starter","commit_stats":null,"previous_names":["technway/graphql-starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Fgraphql-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Fgraphql-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Fgraphql-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Fgraphql-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technway","download_url":"https://codeload.github.com/technway/graphql-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241968665,"owners_count":20050434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql-api","headless-wordpress","starter-theme","wordpress-theme","wpgraphql"],"created_at":"2025-03-05T05:20:13.507Z","updated_at":"2025-03-05T05:20:14.176Z","avatar_url":"https://github.com/technway.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://i.ibb.co/QMrspvp/graphql-starter-logo.png\" alt=\"GraphQL Starter Logo\"\u003e\n\u003ch1\u003eGraphQL Starter\u003c/h1\u003e\n\n\u003cp\u003eThe \u003cstrong\u003eGraphQL Starter Theme\u003c/strong\u003e is a specialized headless WordPress theme designed to function purely as a GraphQL API endpoint. It eliminates traditional frontend rendering and focuses solely on providing a clean and efficient GraphQL API interface.\u003c/p\u003e\n\n\u003ca href=\"https://wordpress.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/WordPress-6.7-blue.svg\" alt=\"WordPress\"\u003e\u003c/a\u003e\n\u003ca href=\"https://php.net/\"\u003e\u003cimg src=\"https://img.shields.io/badge/PHP-7.2+-purple.svg\" alt=\"PHP\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.gnu.org/licenses/gpl-2.0.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-GPL--2.0-green.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n---\n\n- [Features](#features)\n  - [Core Capabilities](#core-capabilities)\n  - [Custom Post Types and Fields](#custom-post-types-and-fields)\n  - [GraphQL Capabilities](#graphql-capabilities)\n- [Installation](#installation)\n  - [Using Composer (Recommended)](#using-composer-recommended)\n  - [Manual Installation](#manual-installation)\n  - [Rename Theme](#rename-theme)\n- [Theme Configuration](#theme-configuration)\n  - [Configuration Constants](#configuration-constants)\n  - [Example Usage](#example-usage)\n- [Directory Structure](#directory-structure)\n  - [`includes/` Directory](#includes-directory)\n    - [`core/` Directory](#core-directory)\n  - [`docs/` Directory](#docs-directory)\n  - [`testing-graphql/` Directory](#testing-graphql-directory)\n- [Usage](#usage)\n- [License](#license)\n- [Support](#support)\n- [Credits](#credits)\n\n\n**This lightweight and secure solution is ideal for:**\n- Public content APIs\n- Headless frontend applications\n- Scenarios where content management is handled through the WordPress admin interface\n\nThe theme has no authentication system, anonymous access is allowed to specific GraphQL queries and mutations. The following mutations are available:\n- Comment creation\n- Post like toggling\n\n## Features\n\n### Core Capabilities\n- **Headless WordPress API:** Designed to serve as a GraphQL API for seamless integration with modern frontend frameworks like React, Vue, or Angular.\n\n### Custom Post Types and Fields\n- Easy-to-use `CustomPostType` and `CustomField` classes for registering and managing post types and custom fields.\n- Automatically integrates custom post types and fields into the GraphQL schema.\n- Flexible configuration options for easy customization\n\n\u003e Check the [`docs/custom-post-types.md`](docs/custom-post-types.md) and [`docs/custom-fields.md`](docs/custom-fields.md) files for more information on registering custom post types and custom fields.\n\n### GraphQL Capabilities\n- **Read Operations Examples:**\n  - Query post types\n  - Retrieve posts and their data\n  - Access custom fields\n  - Social sharing URLs for Posts\n\n- **Write Operations Examples:**\n  - Create comments on posts\n  - Toggle post likes\n- No authentication required for public operations (Anonymous access).\n\n---\n\n## Installation\n\n### Using Composer (Recommended)\n```bash\ncomposer create-project technway/graphql-starter your-theme-name --no-dev\n```\n\n### Manual Installation\n1. Download/Clone the theme from the [Technway repository](https://github.com/technway/graphql-starter).\n   ```bash\n   git clone https://github.com/technway/graphql-starter.git\n   ```\n2. Upload the theme folder to your WordPress installation directory under `/wp-content/themes/`.\n3. Activate the theme via the WordPress admin panel under **Appearance \u003e Themes**.\n4. Install and activate the [WPGraphQL plugin](https://wordpress.org/plugins/wp-graphql/).\n\n### Rename Theme\n\nUse the `rename-theme.php` script to rename the theme. The script updates all references across relevant files while preserving formatting.\n\n**Run the script from the root of the theme directory:**\n```bash\nphp ./scripts/rename-theme.php \"Your New Theme Name\"\n```\n\nExample:\n```bash\nphp ./scripts/rename-theme.php \"My Custom GraphQL Theme\"\n```\n\n---\n\n\n## Theme Configuration\n\nThe `theme.config.php` file contains essential configuration constants that control various features of the theme. These constants determine which functionalities are enabled or disabled.\n\n### Configuration Constants\n\n| Constant | Type | Default | Description |\n|----------|------|---------|-------------|\n| `GRAPHQL_STARTER_ENABLE_CUSTOM_POST_TYPES` | boolean | `false` | Controls whether custom post types are enabled. When true, allows registration of custom post types. See [`docs/custom-post-types.md`](docs/custom-post-types.md) for details. |\n| `GRAPHQL_STARTER_ENABLE_CUSTOM_FIELDS` | boolean | `false` | Controls whether custom fields are enabled. When true, allows registration of custom fields. See [`docs/custom-fields.md`](docs/custom-fields.md) for details. |\n| `GRAPHQL_STARTER_LIKE_POSTS_ENABLED` | boolean | `false` | Enables/disables the post likes system. When true, activates like/unlike queries and mutations. See [`docs/blog-posts.md`](docs/blog-posts.md) for details. |\n| `GRAPHQL_STARTER_POST_PAGES_COUNT_ENABLED` | boolean | `true` | Controls whether total pages count is available in GraphQL queries. When true, adds 'total' field to pageInfo in post queries. Useful for pagination UI. See [`docs/blog-posts.md`](docs/blog-posts.md) for details. |\n| `GRAPHQL_STARTER_SOCIAL_SHARE_ENABLED` | boolean | `false` | Controls whether social sharing URLs are available in post queries. See [`docs/blog-posts.md`](docs/blog-posts.md) for details |\n| `GRAPHQL_STARTER_REDIRECT_FRONTEND_ENABLED` | boolean | `true` | Controls whether the frontend is redirected to the admin dashboard. When true, the frontend is redirected to the admin dashboard.|\n\n### Example Usage\nWhen `GRAPHQL_STARTER_POST_PAGES_COUNT_ENABLED` is true, you can query post pagination counts.\n\nFor detailed information about each feature. See the [`docs/`](./docs/) directory.\n\n## Directory Structure\n\n```\ngraphql-starter/                   # Root directory of the theme\n├── includes/                      # Core functionalities of the theme\n│   ├── core/                      # Essential reusable components and logic\n│   │   ├── classes/               # PHP classes for managing CPTs and CFs\n│   │   │   ├── CustomField.php          # Class for defining custom fields\n│   │   │   ├── CustomFieldRenderer.php  # Class for rendering custom fields\n│   │   │   ├── CustomPostType.php       # Class for defining custom post types\n│   │   ├── bootstrap/             # Initialization files for CPTs and fields\n│   │   │   ├── cf-bootstrap.php   # Initializes custom fields\n│   │   │   ├── cpt-bootstrap.php  # Initializes custom post types\n│   │   ├── graphql/               # Files specific to GraphQL setup\n│   │   │   ├── graphql-setup.php  # Configures GraphQL endpoints and settings\n│   │   ├── custom-fields.php          # Registers and manages custom fields\n│   │   ├── post-types.php             # Registers and manages custom post types\n├── scripts/                       # Utility scripts for automation\n│   ├── rename-theme.php           # Script to rename theme references\n├── testing-graphql/               # GraphQL query test files for debugging\n│   ├── *.http                     # HTTP files for testing GraphQL queries and mutations\n│   ├── testing-graphql.md         # Documentation for testing GraphQL\n├── docs/                          # Documentation files for the theme\n├── functions.php                  # Main WordPress functions file\n├── index.php                      # Empty index file\n├── theme.config.php               # Theme configuration\n```\n\n### `includes/` Directory\nThe `includes/` directory contains the core classes used to register custom post types (CPTs) and custom fields (CFs). These classes simplify the process of creating and managing CPTs and CFs within the theme. It also contains the `custom-fields.php` and `post-types.php` files, which are used to register custom fields and post types respectively.\n\n#### `core/` Directory\nThe `core/` directory contains the reusable classes used to register custom post types (CPTs) and custom fields (CFs). These classes simplify the process of creating and managing CPTs and CFs within the theme.\n\n### `docs/` Directory\nThe `docs/` directory contains additional detailed documentation files about the theme, its architecture, and usage examples. Refer to [`docs/usage.md`](docs/usage.md) for more information on registering custom post types and custom fields.\n\n### `testing-graphql/` Directory\nThe `testing-graphql/` directory contains a `.http` file for testing GraphQL queries. Refer to [`testing-graphql.md`](testing-graphql/testing-graphql.md) for more information on testing GraphQL queries.\n\n---\n\n## Usage\n\n- Read the [`blog-posts.md`](docs/blog-posts.md) file for more information on get posts in different scenarios and getting or toggling likes.\n- Read the [`custom-post-types.md`](docs/custom-post-types.md) file for more information on registering custom post types.\n- Read the [`custom-fields.md`](docs/custom-fields.md) file for more information on registering custom fields.\n\n---\n\n## License\nThis theme is licensed under the GNU General Public License v2 or later (GPL-2.0). See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Support\nFor support and contributions, visit the [Technway GitHub repository](https://github.com/technway/graphql-starter).\n\n---\n\n## Credits\nThe GraphQL Starter Theme is built with ❤️ and maintained by **[Technway](https://technway.biz)**. Special thanks to the creators of [WPGraphQL](https://www.wpgraphql.com/) for their excellent plugin.\n\nContributions are welcome! Feel free to fork the repository and submit pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnway%2Fgraphql-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnway%2Fgraphql-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnway%2Fgraphql-starter/lists"}