Fixes #32685 - update graphql to 1.13.0+
Issues: #32685
@timogoebel @kamils-iRonin ohai, I recall y'all have poked around GraphQL in the past. Would you mind having a look at the errors and tell me WTH I am doing wrong?
To save you some clicks:
Failure:
Queries::HostQueryTest::with user without view_models permission#test_0001_does not load associated model [/home/jenkins/workspace/test_develop_pr_core/database/postgresql/ruby/2.7/slave/fast/test/graphql/queries/host_query_test.rb:156]
Minitest::Assertion: Expected {"id"=>"MDE6TW9kZWwtOTgwMTkwOTY5"} to be nil.
Failure:
Queries::NodesQueryTest::as user without view_models permission#test_0001_does not fetch the record [/home/jenkins/workspace/test_develop_pr_core/database/postgresql/ruby/2.7/slave/fast/test/graphql/queries/nodes_query_test.rb:71]
Minitest::Assertion: Expected [{"message"=>"Argument 'id' on Field 'node' has an invalid value (MDE6TW9kZWwtOTgwMTkwOTgw). Expected type 'ID!'.", "locations"=>[{"line"=>2, "column"=>9}], "path"=>["query getNode", "node", "id"], "extensions"=>{"code"=>"argumentLiteralsIncompatible", "typeName"=>"Field", "argumentName"=>"id"}}] to be empty.
Failure:
Queries::NodesQueryTest#test_0001_fetching node by relay global id [/home/jenkins/workspace/test_develop_pr_core/database/postgresql/ruby/2.7/slave/fast/test/graphql/queries/nodes_query_test.rb:27]
Minitest::Assertion: Expected [{"message"=>"Argument 'id' on Field 'node' has an invalid value (MDE6TW9kZWwtOTgwMTkwOTg1). Expected type 'ID!'.", "locations"=>[{"line"=>2, "column"=>9}], "path"=>["query getNode", "node", "id"], "extensions"=>{"code"=>"argumentLiteralsIncompatible", "typeName"=>"Field", "argumentName"=>"id"}}] to be empty.
Failure:
Queries::NodesQueryTest#test_0002_fetching multiple nodes by relay global id [/home/jenkins/workspace/test_develop_pr_core/database/postgresql/ruby/2.7/slave/fast/test/graphql/queries/nodes_query_test.rb:50]
Minitest::Assertion: Expected [{"message"=>"Argument 'ids' on Field 'nodes' has an invalid value ([MDE6TW9kZWwtOTgwMTkwOTg2]). Expected type '[ID!]!'.", "locations"=>[{"line"=>2, "column"=>9}], "path"=>["query getNodes", "nodes", "ids"], "extensions"=>{"code"=>"argumentLiteralsIncompatible", "typeName"=>"Field", "argumentName"=>"ids"}}] to be empty.
@evgeni Thanks for the effort! I was stumbling across this for foreman_puppet, yesterday. Would be nice to mark this PR with the Breaking change label, I suppose :)
@nadjaheitmann why would this be a breaking change?
@evgeni Because it would update the graphql gem and plugins need to update their graphql as well if they support it
Ah, that way round. Yeah, indeed!
@evgeni Thanks! I find that label quite useful for plugin maintainers :)
rebased, not that it'll pass tests or anything now, but rebased :)
Yay, thanks to @ofedoren the tests are green!
Katello failure is related tho ;)
@ofedoren any idea how to solve the Katello side?
@ofedoren any idea how to solve the Katello side?
I guess? Let's see if the tests will pass now.
But anyway, this update will break other plugin tests, e.g. foreman_ansible. Hopefully the tests only...
I've added https://github.com/theforeman/foreman/pull/9230/commits/6b557cf4ee7a600dce03fe24079b70c6d0cb1a5a as a solution/workaround for custom names of the types. We do that in plugins since our models/types are scoped by plugin's name. Unfortunatelly the name can't contain :: and our main "hack" [1] does no longer works [2].
[1] - https://github.com/Katello/katello/blob/master/app/graphql/types/host_collection.rb#L14-L16 This also is present in other plugins, but this can be safely removed after the library is updated. Just dead code. [2] - https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG.md#1131-13-december-2021
:green_apple: