Skip to content

Conversation

@amermchaudhary
Copy link
Contributor

Q A
Branch? 4.0
Tickets Closes #6807
License MIT

@dunglas
Copy link
Member

dunglas commented Nov 19, 2024

Thanks! Would you mind adding a test?

@amermchaudhary
Copy link
Contributor Author

amermchaudhary commented Nov 19, 2024

@dunglas I created a test for this but the test is failing because of another bug. I will add that bug and try to fix it as well. Basically I tried to add a create mutation for the book but the mutation is not working because its expecting an author of type string.

Field "author" of required type "String!" was not provided.

@amermchaudhary
Copy link
Contributor Author

amermchaudhary commented Nov 19, 2024

@dunglas Nevermind, that was my mistake. Tests have been added. Additionally I also see a problem with array casting. Should I fix it in the same PR or do you want me to create a separate bug and corresponding PR? It's a one liner fix and perhaps if you want a test added then some test work

@dunglas
Copy link
Member

dunglas commented Nov 20, 2024

Adding the fix and the test in this PR, or creating a new one are both OK.

Don't bother opening a new issue, the describing the fix in the PR description is enough.

Thank you for these fixes!

$author = AuthorFactory::new()->create();
$response = $this->postJson('/api/graphql', [
'query' => '
mutation createBook($book: createBookInput!){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you could use nowdoc strings for readability.

@soyuka soyuka merged commit 7ff9790 into api-platform:4.0 Nov 20, 2024
58 of 59 checks passed
@soyuka
Copy link
Member

soyuka commented Nov 20, 2024

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants