Skip to content

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

@medunrad

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.

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