youshido-php / GraphQL

Pure PHP realization of GraphQL protocol
MIT License
710 stars 107 forks source link

Add more robust implementation for TypeService::getPropertyValue() #224

Closed Jalle19 closed 5 years ago

Jalle19 commented 5 years ago

Fixes #210, also incidentally fixes #203, closes #98

I added some test cases against the initial implementation first, then some broken test cases, then switched to using symfony/property-accessor and all the tests started passing. A net gain in my opinion.

A third parameter $enableMagicCall has been added to getPropertyValue() to allow resolving properties from objects implementing __call() for getters. It's an optional feature of symfony/property-accessor and can be quite obscure if implicitly enabled, so I added a flag for it.