-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-869: Fixed loading of mutations schema #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one fails after #26 has been merged.
When I try to execute a mutation like:
mutation createFolder {
createFolder(
language: eng_GB
parentLocationId: 2
input: {
name: "New Folder"
}
) {
id
}
}
Then the server response looks like this:
{
"errors": [
{
"debugMessage": "Too few arguments to function Ibexa\\GraphQL\\Resolver\\DomainContentMutationResolver::createDomainContent(), 1 passed in /Users/mareknocon/Desktop/Sites/v3_4/vendor/overblog/graphql-bundle/src/Resolver/AbstractProxyResolver.php on line 36 and exactly 4 expected",
"message": "Internal server Error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"createFolder"
],
"trace": [
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/overblog/graphql-bundle/src/Resolver/AbstractProxyResolver.php",
"line": 36,
"call": "Ibexa\\GraphQL\\Resolver\\DomainContentMutationResolver::createDomainContent(array(4))"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/overblog/graphql-bundle/src/Definition/GraphQLServices.php",
"line": 34,
"call": "Overblog\\GraphQLBundle\\Resolver\\AbstractProxyResolver::resolve(array(2))"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/var/cache/behat/overblog/graphql-bundle/__definitions__/ItemMutationType.php",
"line": 136,
"call": "Overblog\\GraphQLBundle\\Definition\\GraphQLServices::mutation('CreateDomainContent', array(4))"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/overblog/graphql-bundle/src/Definition/ArgumentFactory.php",
"line": 37,
"call": "Overblog\\GraphQLBundle\\__DEFINITIONS__\\ItemMutationType::Overblog\\GraphQLBundle\\__DEFINITIONS__\\{closure}(null, instance of Overblog\\GraphQLBundle\\Definition\\Argument(3), instance of ArrayObject(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 623,
"call": "Overblog\\GraphQLBundle\\Definition\\ArgumentFactory::Overblog\\GraphQLBundle\\Definition\\{closure}(null, array(3), instance of ArrayObject(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 550,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError(instance of GraphQL\\Type\\Definition\\FieldDefinition, instance of GraphQL\\Language\\AST\\FieldNode, instance of Closure, null, instance of GraphQL\\Type\\Definition\\ResolveInfo)"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 474,
"call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: ItemMutation, null, instance of ArrayObject(1), array(1))"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 857,
"call": "GraphQL\\Executor\\ReferenceExecutor::GraphQL\\Executor\\{closure}(array(0), 'createFolder')"
},
{
"call": "GraphQL\\Executor\\ReferenceExecutor::GraphQL\\Executor\\{closure}(array(0), 'createFolder')"
},
{
"file": "/Users/mareknocon/Desktop/Sites/v3_4/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 859,
"function": "array_reduce(array(1), instance of Closure, array(0))"
},
(...)
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
In v0.14 of the overblog/graphql-bundle, the arguments for "@=mutation" have been changed from an array to a sequence of arguments.
ed6f2b3
to
444dec1
Compare
@bdunogier Have you addressed @mnocon feedback ? |
Yes @adamwojs, this is what the 2nd commit does. |
Thanks Bertrand, I've added it to our QA queue |
Current status. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Pushed an extra change that fixes the arguments for the few remaining mutations. I have only tested |
Current status. create content OK Exception:
|
Note that I’m getting a different error (arguments exception) on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA Approved on Ibexa Commerce 4.2.4-dev.
There's green light for handling file upload separately, ticket will be created shortly.
New ticket: https://issues.ibexa.co/browse/IBX-4415. |
The schema mutation type is set by detecting what files were generated. When ezsystems/ezplatform-graphql#90 was merged,
DomainContentMutation.types.yaml
was renamed toItemMutation.types.yaml
, but theYamlSchemaProvider
that searches for the files was not updated.In addition, in v0.14 of overblog/graphql-bundle, the
mutation
function, used to resolve mutations, has been changed. The arguments are not provided as an array anymore, but as regular function arguments. This is the reason for the error @mnocon found. The behaviour had been changed earlier (in v0.13 as far as I can see) but had a compatibility layer that was removed in v0.14.Note that the
query
function, that replaces theresolve
one, has undergone the same change, and we will need to update it as well.