-
-
Notifications
You must be signed in to change notification settings - Fork 924
Closed
Labels
Description
API Platform version(s) affected: 2.5.1
Description
When resources are defined in yaml instead of Doctrine GraphQL will not show them as embedded resources for mutations.
The schema definition
App\Entity\Book:
collectionOperations: ~
itemOperations: ~
attributes:
normalization_context:
groups: ['Book']
denormalization_context:
groups: ['Book']
properties:
id:
readonly: true
title:
required: true
pages:
subresource:
resourceClass: 'App\Entity\Page'
collection: true
App\Entity\Page:
collectionOperations: ['get']
itemOperations: ['get']
attributes:
normalization_context:
groups: ['Book']
denormalization_context:
groups: ['Book']
properties:
id:
readonly: true
content:
required: true
And serialization config
App\Entity\Book:
attributes:
id:
groups: ['Book']
title:
groups: ['Book']
pages:
groups: ['Book']
App\Entity\Page:
attributes:
id:
groups: ['Book']
content:
groups: ['Book']
Will create the following createBookInput
object in graphql
How to reproduce
- Checkout the project https://github.com/Fgruntjes/api-platform-graphql-issue
- composer install
- Open GraphiQl viewer
Additional Context
Similar to these issues but @alanpoulain suggested that they are likely not the same.