Reference: recognized directories
The builder determines a class' role from the directory it lives in, relative to the code-API root (src/Api/ for core, <plugin>/src/Api/ for a plugin). Arbitrary nested subdirectories are allowed for organization and do not change the role; e.g. Queries/Coupons/GetCoupon.php and Queries/GetCoupon.php are both queries.
| Directory | Role | What it holds |
|---|---|---|
Queries/ | GraphQL query | Command classes with an execute() method. Name defaults to camelCase of the class name. |
Mutations/ | GraphQL mutation | Command classes with an execute() method. Rejected over GET. |
Types/ | Output type | Plain classes whose public properties become fields. |
InputTypes/ | Input type | Plain classes used as execute() arguments; a field is optional when its type is nullable or it has a default. |
Enums/ | Enum type | Backed PHP enums. Case names become SCREAMING_SNAKE_CASE. |
Interfaces/ | Interface | PHP traits marked #[Name]/#[Description]; types use them to implement. |
Scalars/ | Custom scalar | Classes with static serialize() / parse(). Applied to fields via #[ScalarType]. |
Pagination/ | Pagination support | Connection, Edge, PageInfo, PaginationParams, cursor helpers (provided by core; reused, not redefined). |
Attributes/ | Attribute definitions | Custom PHP 8 attributes (authorization, metadata, …). See Attributes. |
Infrastructure/ | Convention classes | Optional per-plugin ClassResolver, PrincipalResolver, principal class, HttpStatusResolver. See Infrastructure classes. |
Utils/ | Helpers | Mappers, repositories, and other plain helpers. Not exposed in the schema. |
Notes:
- Classes the builder shouldn't expose can be excluded with
#[Ignore]regardless of placement (e.g. a helper that happens to live under a scanned directory). - The generated output mirrors these roles under
Internal/Api/Autogenerated/(GraphQLQueries/,GraphQLMutations/,GraphQLTypes/{Output,Input,Enums,Interfaces,Scalars,Pagination}/), but you never edit that tree; see Building and staleness checks. - These conventions are identical for core and for plugins.