https://github.com/jerowork/graphql-attribute-schema
Build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of array-based configuration.
https://github.com/jerowork/graphql-attribute-schema
attributes graphql webonyx
Last synced: 26 days ago
JSON representation
Build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of array-based configuration.
- Host: GitHub
- URL: https://github.com/jerowork/graphql-attribute-schema
- Owner: jerowork
- License: mit
- Created: 2025-01-02T14:21:36.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-24T17:23:34.000Z (about 1 month ago)
- Last Synced: 2025-09-24T19:25:52.472Z (about 1 month ago)
- Topics: attributes, graphql, webonyx
- Language: PHP
- Homepage: https://jerowork.github.io/graphql-attribute-schema/
- Size: 924 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- trackawesomelist - jerowork/graphql-schema-builder (⭐1) - Easily build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of large configuration arrays. (Recently Updated / [Feb 11, 2025](/content/2025/02/11/README.md))
README
# GraphQL Attribute Schema
[](https://github.com/jerowork/graphql-attribute-schema/actions)
[](https://scrutinizer-ci.com/g/jerowork/graphql-attribute-schema/code-structure)
[](https://scrutinizer-ci.com/g/jerowork/graphql-attribute-schema)
[](LICENSE)
[](https://packagist.org/packages/jerowork/graphql-attribute-schema)
[](https://packagist.org/packages/jerowork/graphql-attribute-schema)
Build your GraphQL schema for [webonyx/graphql-php](https://github.com/webonyx/graphql-php) using **PHP attributes** instead of array-based configuration.
## Why use this library?
The [webonyx/graphql-php](https://github.com/webonyx/graphql-php) package requires a **schema** to run a GraphQL server. Normally, this schema is defined based on array configuration.
This package introduces PHP attributes to configure your GraphQL schema instead. By adding attributes (`#[Mutation]`, `#[Query]`, `#[Type]`, etc.) directly to your classes, this library **automatically generates** the GraphQL schema for you.
## 📖 Documentation
The documentation is available on [GitHub pages](https://jerowork.github.io/graphql-attribute-schema/docs) or in the [GitHub repository](https://github.com/jerowork/graphql-attribute-schema/blob/main/docs/index.md).
There is also an example application using most of the features at [https://github.com/jerowork/example-application-graphql-attribute-schema](https://github.com/jerowork/example-application-graphql-attribute-schema).