pop-api / api-graphql
Extended/Upgraded implementation of GraphQL, implemented on PHP, based on the PoP API
Requires
- php: ^8.1
- pop-api/api-mirrorquery: ^6.0.1
Requires (Dev)
- phpstan/phpstan: ^1.8
- phpunit/phpunit: ^10.2
- rector/rector: ^0.18
- squizlabs/php_codesniffer: ^3.6
Conflicts
- gatographql/external-dependency-wrappers: <6.0.1
- gatographql/gatographql: <6.0.1
- gatographql/plugin-utils: <6.0.1
- gatographql/testing-schema: <6.0.1
- getpop/access-control: <6.0.1
- getpop/cache-control: <6.0.1
- getpop/component-model: <6.0.1
- getpop/componentrouting: <6.0.1
- getpop/definitions: <6.0.1
- getpop/dom-crawler: <6.0.1
- getpop/engine: <6.0.1
- getpop/engine-wp: <6.0.1
- getpop/engine-wp-bootloader: <6.0.1
- getpop/filestore: <6.0.1
- getpop/graphql-parser: <6.0.1
- getpop/guzzle-http: <6.0.1
- getpop/loosecontracts: <6.0.1
- getpop/mandatory-directives-by-configuration: <6.0.1
- getpop/markdown-convertor: <6.0.1
- getpop/root: <6.0.1
- getpop/root-wp: <6.0.1
- graphql-by-pop/graphiql: <6.0.1
- graphql-by-pop/graphql-clients-for-wp: <6.0.1
- graphql-by-pop/graphql-endpoint-for-wp: <6.0.1
- graphql-by-pop/graphql-request: <6.0.1
- graphql-by-pop/graphql-server: <6.0.1
- graphql-by-pop/graphql-voyager: <6.0.1
- phpunit-for-gatographql/dummy-schema: <6.0.1
- phpunit-for-gatographql/dummy-wp-schema: <6.0.1
- phpunit-for-gatographql/gatographql: <6.0.1
- phpunit-for-gatographql/gatographql-testing: <6.0.1
- phpunit-for-gatographql/webserver-requests: <6.0.1
- phpunit-for-gatographql/wpfaker-schema: <6.0.1
- pop-api/api: <6.0.1
- pop-api/api-clients: <6.0.1
- pop-api/api-endpoints: <6.0.1
- pop-api/api-endpoints-for-wp: <6.0.1
- pop-api/api-rest: <6.0.1
- pop-backbone/php-hooks: <6.0.1
- pop-backbone/wp-data-parser: <6.0.1
- pop-cms-schema/categories: <6.0.1
- pop-cms-schema/categories-wp: <6.0.1
- pop-cms-schema/category-mutations: <6.0.1
- pop-cms-schema/category-mutations-wp: <6.0.1
- pop-cms-schema/comment-mutations: <6.0.1
- pop-cms-schema/comment-mutations-wp: <6.0.1
- pop-cms-schema/commentmeta: <6.0.1
- pop-cms-schema/commentmeta-wp: <6.0.1
- pop-cms-schema/comments: <6.0.1
- pop-cms-schema/comments-wp: <6.0.1
- pop-cms-schema/custompost-categories-wp: <6.0.1
- pop-cms-schema/custompost-category-mutations: <6.0.1
- pop-cms-schema/custompost-category-mutations-wp: <6.0.1
- pop-cms-schema/custompost-mutations: <6.0.1
- pop-cms-schema/custompost-mutations-wp: <6.0.1
- pop-cms-schema/custompost-tag-mutations: <6.0.1
- pop-cms-schema/custompost-tag-mutations-wp: <6.0.1
- pop-cms-schema/custompost-tags-wp: <6.0.1
- pop-cms-schema/custompost-user-mutations: <6.0.1
- pop-cms-schema/custompost-user-mutations-wp: <6.0.1
- pop-cms-schema/custompostmedia: <6.0.1
- pop-cms-schema/custompostmedia-mutations: <6.0.1
- pop-cms-schema/custompostmedia-mutations-wp: <6.0.1
- pop-cms-schema/custompostmedia-wp: <6.0.1
- pop-cms-schema/custompostmeta: <6.0.1
- pop-cms-schema/custompostmeta-wp: <6.0.1
- pop-cms-schema/customposts: <6.0.1
- pop-cms-schema/customposts-wp: <6.0.1
- pop-cms-schema/media: <6.0.1
- pop-cms-schema/media-mutations: <6.0.1
- pop-cms-schema/media-mutations-wp: <6.0.1
- pop-cms-schema/media-wp: <6.0.1
- pop-cms-schema/menus: <6.0.1
- pop-cms-schema/menus-wp: <6.0.1
- pop-cms-schema/meta: <6.0.1
- pop-cms-schema/metaquery-wp: <6.0.1
- pop-cms-schema/page-mutations: <6.0.1
- pop-cms-schema/page-mutations-wp: <6.0.1
- pop-cms-schema/pagemedia-mutations: <6.0.1
- pop-cms-schema/pages: <6.0.1
- pop-cms-schema/pages-wp: <6.0.1
- pop-cms-schema/post-categories: <6.0.1
- pop-cms-schema/post-categories-wp: <6.0.1
- pop-cms-schema/post-category-mutations: <6.0.1
- pop-cms-schema/post-mutations: <6.0.1
- pop-cms-schema/post-tag-mutations: <6.0.1
- pop-cms-schema/post-tags: <6.0.1
- pop-cms-schema/post-tags-wp: <6.0.1
- pop-cms-schema/postmedia-mutations: <6.0.1
- pop-cms-schema/posts: <6.0.1
- pop-cms-schema/posts-wp: <6.0.1
- pop-cms-schema/queriedobject: <6.0.1
- pop-cms-schema/queriedobject-wp: <6.0.1
- pop-cms-schema/schema-commons: <6.0.1
- pop-cms-schema/schema-commons-wp: <6.0.1
- pop-cms-schema/settings: <6.0.1
- pop-cms-schema/settings-wp: <6.0.1
- pop-cms-schema/tag-mutations: <6.0.1
- pop-cms-schema/tag-mutations-wp: <6.0.1
- pop-cms-schema/tags: <6.0.1
- pop-cms-schema/tags-wp: <6.0.1
- pop-cms-schema/taxonomies: <6.0.1
- pop-cms-schema/taxonomies-wp: <6.0.1
- pop-cms-schema/taxonomy-mutations: <6.0.1
- pop-cms-schema/taxonomy-mutations-wp: <6.0.1
- pop-cms-schema/taxonomymeta: <6.0.1
- pop-cms-schema/taxonomymeta-wp: <6.0.1
- pop-cms-schema/taxonomyquery: <6.0.1
- pop-cms-schema/taxonomyquery-wp: <6.0.1
- pop-cms-schema/user-avatars: <6.0.1
- pop-cms-schema/user-avatars-wp: <6.0.1
- pop-cms-schema/user-roles: <6.0.1
- pop-cms-schema/user-roles-wp: <6.0.1
- pop-cms-schema/user-state: <6.0.1
- pop-cms-schema/user-state-mutations: <6.0.1
- pop-cms-schema/user-state-mutations-wp: <6.0.1
- pop-cms-schema/user-state-wp: <6.0.1
- pop-cms-schema/usermeta: <6.0.1
- pop-cms-schema/usermeta-wp: <6.0.1
- pop-cms-schema/users: <6.0.1
- pop-cms-schema/users-wp: <6.0.1
- pop-schema/directive-commons: <6.0.1
- pop-schema/extended-schema-commons: <6.0.1
- pop-schema/http-requests: <6.0.1
- pop-schema/schema-commons: <6.0.1
- pop-wp-schema/block-content-parser: <6.0.1
- pop-wp-schema/blocks: <6.0.1
- pop-wp-schema/commentmeta: <6.0.1
- pop-wp-schema/comments: <6.0.1
- pop-wp-schema/custompostmeta: <6.0.1
- pop-wp-schema/customposts: <6.0.1
- pop-wp-schema/media: <6.0.1
- pop-wp-schema/menus: <6.0.1
- pop-wp-schema/meta: <6.0.1
- pop-wp-schema/multisite: <6.0.1
- pop-wp-schema/pages: <6.0.1
- pop-wp-schema/posts: <6.0.1
- pop-wp-schema/schema-commons: <6.0.1
- pop-wp-schema/settings: <6.0.1
- pop-wp-schema/site: <6.0.1
- pop-wp-schema/taxonomymeta: <6.0.1
- pop-wp-schema/usermeta: <6.0.1
- pop-wp-schema/users: <6.0.1
- dev-master / 6.1.x-dev
- 6.0.1
- 6.0.0
- 5.0.0
- 4.2.0
- 4.1.1
- 4.1.0
- 4.0.1
- 4.0.0
- 3.0.0
- 2.6.1
- 2.6.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.6.0
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.10
- 0.9.9
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.9
- 0.8.8
- 0.8.7
- 0.8.6
- 0.8.5
- 0.8.4
- v0.8.3
- v0.8.2
- 0.8.1
- 0.7.13
- 0.7.12
- 0.7.11
- 0.7.10
- 0.7.9
- 0.7.8
- 0.7.7
- 0.7.6
This package is auto-updated.
Last update: 2024-10-06 11:34:53 UTC
README
Extended/Upgraded implementation of GraphQL. This implementation is a package to be installed on top of the PoP API.
Install
Via Composer
composer require pop-api/api-graphql
Development
The source code is hosted on the GatoGraphQL monorepo, under API/packages/api-graphql
.
To enable pretty API endpoint /api/graphql/
, follow the instructions here
Note: if you wish to install a fully-working API, please follow the instructions under Bootstrap a PoP API for WordPress (even though CMS-agnostic, only the WordPress adapters have been presently implemented).
Usage
Initialize the component:
\PoP\Root\App::stockAndInitializeModuleClasses([([ \PoPAPI\GraphQLAPI\Module::class, ]);
Features
Automatic namespacing of types
Namespaces (proposed to be added to the GraphQL spec) help manage the complexity of the schema. This can avoid different types having the same name, which can happen when embedding components from a 3rd party.
This is how the normal schema looks like in the GraphQL Voyager:
This is how it looks in its namespaced version:
Field/directive-based versioning
Fields and directives can be independently versioned, and the version to use can be specified in the query through the field/directive argument versionConstraint
.
To select the version for the field/directive, we use the same semver version constraints employed by Composer.
PHP versions
Requirements:
- PHP 8.1+ for development
- PHP 7.2+ for production
Supported PHP features
Check the list of Supported PHP features in GatoGraphQL/GatoGraphQL
Preview downgrade to PHP 7.2
Via Rector (dry-run mode):
composer preview-code-downgrade
Standards
To check the coding standards via PHP CodeSniffer, run:
composer check-style
To automatically fix issues, run:
composer fix-style
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
To execute PHPUnit, run:
composer test
Static Analysis
To execute PHPStan, run:
composer analyse
Report issues
To report a bug or request a new feature please do it on the GatoGraphQL monorepo issue tracker.
Contributing
We welcome contributions for this package on the GatoGraphQL monorepo (where the source code for this package is hosted).
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email leo@getpop.org instead of using the issue tracker.
Credits
License
GNU General Public License v2 (or later). Please see License File for more information.