Skip to content

Bad PHPStan type for $variables parameter of Client::runQuery #7

Description

@medunrad

First of all, thanks for saving this package ❤️

I think that the PHPStan type of parameter $variables of Client::runQuery is not correct. There is type @param array<string,string> $variables, but I think that @param array<string, mixed> $variables suits better.

Look at this GraphQL query:

mutation($checkYoutubeVideoParam: CheckYoutubeVideoParam!) {
  checkYoutubeVideo(checkYoutubeVideoParam: $checkYoutubeVideoParam) {
    message
    success
  }
}

variables:

{
  "checkYoutubeVideoParam":{
    "videoId":"123456"
  }
}

As far as I know, I need to pass an array:

[
  'checkYoutubeVideoParam' => [
    'videoId' => '123456'
  ]
];

which does not suit the type above.

Everything works, but PHPStan is not satisfied.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions