As the title states, I want to be able to test the upload of a file using the available scalar while also providing additional parameters to the same mutation. The documentation provides a helper on how to test this Lighthouse docs simulating file uploads. But my mutation also needs some additional dynamic parameters for the test. But I can't figure out how to provide these additional parameters. An example of my current setup:
$response = $this->multipartGraphQL(['operations' => {
"query": "mutation ($file: Upload!) {registerUser(email: $email, files: [$file]) {courseRegistrationFiles{id}}}",
"variables": {"file": null}
}', 'map' => '{"0": ["variables.file"]}'], [
'0' => UploadedFile::fake()->create('document.pdf', 100)
]);
A few additional notes the $email should be represented using a faked email address, this is done in the line above this snippet. At first, I imagined that I had to provide the email variable within the same brackets as where I define the uploadeFile::fake() but this lead to the error that stated that parameters within this portion of the method should be of the type UploaedFile
. After that I've also tried simply adding them to the map/variables portions but this lead to the param being null.