Skip to content

ResolveInfo not available in Query #1186

Description

@fp-cfr
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Version/Branch 1.1.0

Hello, I'm working on a large project with the update of the lib from version 1.0.0 to version 1.4.0. The following code is used which causes problems with the update:

#[GQL\Query(resolve: "query('CurrentClass:: getUser', info, args.id)")]
#[GQL\Arg('id', 'String!')]
public function getUser(ResolveInfo $info, string $id): User

Error:

Argument n°1 "$resolveInfo" on method "getUser" cannot be auto-guessed from the following type guessers:
[Type Hint] No corresponding GraphQL scalar,enum,input found for class "GraphQL\Type\Definition\ResolveInfo"

Since 1.1.0, is there another way to get ResolveInfo or is the observed behavior a bug?

Activity

  1. AlexOstrovsky commented on Jun 3, 2024

    @AlexOstrovsky

    I am having the same issue @Vincz any suggestion how to get ResolverInfo in Query in versions after 1.1.0?

  2. Vincz commented on Jun 3, 2024

    @Vincz
    Contributor

    Hi guys. In this case, the argument should be ignored from arguments generation in the MetadataParser and it should be populated automatically by the ArgumentsTransformer.
    Any of you want to work on this?

  3. AlexOstrovsky commented on Jun 27, 2024

    @AlexOstrovsky

    @Vincz TBO I looked into it a little and was able to skip arg 'info' in guessArgs of MetadataParser but then I don't see any way to know in ArgumentsTransformer if the Query has 'info' argument like in example: public function getUser(ResolveInfo $info, string $id) because generated function don't know about info as we skipped this argument. Would be so kind and ask someone who knows better what to do to look in it? Thanks.

  4. Vincz commented on Jun 27, 2024

    @Vincz
    Contributor

    Hi @AlexOstrovsky! I'll try to look into it by the end of the week.

  5. AlexOstrovsky commented on Jul 3, 2024

    @AlexOstrovsky

    Hi @Vincz any luck with this?

  6. AlexOstrovsky commented on Jul 19, 2024

    @AlexOstrovsky

    @Vincz did you have time to look at this by any chance?

  7. Vincz commented on Aug 8, 2024

    @Vincz
    Contributor

    Hi @AlexOstrovsky
    You can find here an implementation: #1191
    Let me know what you think

  8. AlexOstrovsky commented on Aug 8, 2024

    @AlexOstrovsky

    @Vincz tried your fork all works as expeted from my point of view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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