Skip to content

Doctrine and GraphQLite #687

@tasselchof

Description

@tasselchof

Guys, what is the best approach for using GraphQLite with Doctrine? I am encountering some issues. One issue I mentioned in #686, but I have others. For example, when I try to do an update mutation, the GraphQL resolver creates the Doctrine entity, and one of my methods should not be null by design:

public function getSomething(): AbstractSomething; 

Yet GraphQLite trying to resolve it which is causing this exception at this point (I am not copying an exception itself as it's obvious why it is happening):

#0 /home/dev/domains/api/vendor/thecodingmachine/graphqlite/src/Middlewares/SourceMethodResolver.php(45): Api\Entity\AbstractOtherThing-> getSometIng()

Generally, I'd appreciate what is the best way here to manage this: when you work with REST service you just hydrating an array to object, here in handler you have two objects that need to be merged in order to make an update (ofc GraphQLite creates not managed object).

Maybe it's a bad approach to map directly Doctrine entities? How do you are approaching this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions