Skip to content

Added support for getters with no prefix on FieldResolver #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2020
Merged

Added support for getters with no prefix on FieldResolver #657

merged 1 commit into from
Mar 2, 2020

Conversation

OwlyCode
Copy link
Contributor

@OwlyCode OwlyCode commented Feb 26, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? no
License MIT

When upgrading to 13.1 my API broke: all of a sudden, some fields were null instead of their actual value.

The problem is inside the FieldResolver, it does not handles methods with no leading get prefix. In my case my entity looks like this:

class Entity
{
    public function hasSomething() {
        //...
    }
}

And the schema:

Entity:
    type: object
    config:
        fields:
            hasSomething:
                type: "Boolean"
            # ...

We want to call $entity->hasSomething() during resolution, not only $entity->getHasSomething().

@mcg-web
Copy link
Contributor

mcg-web commented Mar 2, 2020

Thank you @OwlyCode !

@mcg-web mcg-web merged commit 827e2de into overblog:master Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants