Skip to content

[GraphQL] Better detection of collection types - #3327

Merged
alanpoulain merged 1 commit into
api-platform:2.5from
alanpoulain:graphql-fix-is-collection
Dec 23, 2019
Merged

alanpoulain merged 1 commit into
api-platform:2.5from
alanpoulain:graphql-fix-is-collection

Conversation

@alanpoulain

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets fixes #api-platform/api-platform#1043 #api-platform/api-platform#836
License MIT
Doc PR N/A

It seems some people were having issues when not using Doctrine and when a resource had a collection property.
In this case, the DoctrineExtractor (https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php) is not used and the PhpDocExtractor (https://github.com/symfony/symfony/blob/master/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php) is used instead.

The best way to detect if a type is a collection is to see if the value type has a classname.

It's a long way from #1746 😅

@alanpoulain
alanpoulain merged commit aac9ac3 into api-platform:2.5 Dec 23, 2019
dunglas added a commit that referenced this pull request Jan 13, 2020
* 2.5:
  Update CHANGELOG.md
  [GraphQL] Better detection of collection types (#3327)
  Add tests for building JSON Schema of non-resource class
  Fix JSON Schema generation for non-resource class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant