graphql-ruby: [PRO] Changelog does not include upgrade information on the breaking change
Describe the bug
Hi,
Per the versioning policy, the changelog should include an explanation on how to upgrade for any breaking changes.
pro-1.26.0 included a breaking change around scoping for arrays in the Pundit integration, which has led to several hundred failures. The instructions in the error do not explain how to resolve the error the ‘right way’ very well, imo.
Versions
graphql version: 2.2.5 / pro 1.26.0
rails (or other framework): 7.1.3
Steps to reproduce
This error occurs when querying any field returning an array.
Expected behavior
A clear and concise description of what should do in various cases.
What do I do in the case where we are returning a Hash of data, rather than an object instance? How do I deal with arrays of union or interface types? What does scope: false actually do?
All I want is to skip checks on the Array itself, and instead check with the already-configured policies on the items contained within the Array. How do I do that without having to repeat that configuration all over the place?
Actual behavior
We get errors of the sort
Pundit error: Pundit::NotDefinedError, unable to find scope `Hash::HashPolicy::Scope` for `[{:date=>Mon, 18 Dec 2023, :value=>3.0}, {:date=>Mon, 15 Jan 2024, :value=>5.0}]`
Additional context
I’d like to voice a disagreement about this being a “small” breaking change.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (10 by maintainers)
Ok, thanks for sharing that. It definitely should have looked for the
::Scopeclass in that type. (And maybe it did, but the error got handled wrongly…) I’ll take a closer look tomorrow morning and follow up back here!And, if that is what it did, it should have raised a more descriptive error for how to address it.