-
-
Notifications
You must be signed in to change notification settings - Fork 960
Closed
Description
These days it's impossible to define an item operation for resource without argument. At least id will be added automatically.
The code:
/**
* @ApiResource()
*/
class User
A query generated in the schema:
user(id: ID): User
Proposal
To achieve generation of user: User query we can add next notation:
* @ApiResource(
* graphql={
* "query"={"withoutId", "controller"=ViewerController::class}
SchemaBuilder will prevent using withoutId annotation without custom controller specified.
Motivation
GraphQL can serves not only «batch»/relation requests but provide a way to implement very high level of semantic of API designed. It allows developer to design API in the most correct form and prevent creation of useless operations/endpoints.
Api-platform is desinged to simplify creation of API as much as it possible, so implementing custom operations using #2445 looks really overkill.
Any other ideas? Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels