aws-mobile-appsync-sdk-ios icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-ios copied to clipboard

Make public constructor for GraphQLError

Open fo2rist opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. I wan to test my application that uses AWS AppSync SDK, to properly cover failures I want to create different instances of GraphQLError so I can validated responses, but both constructors of GraphQLError are internal, so there is no way to do so.

Describe the solution you'd like Either make one of the constructors (init method) public or create a public extension to construct GraphQLError for test purposes. Making constructor public should not have any downsides, apart from people constructing and throwing it manually from outside the library code, but it more of style issue and won't affect the library itself. Alternatively if we want to emphasize that instances of GraphQLError should only be created for tests and extension with a clear name and doc would allow to do that.

Describe alternatives you've considered Make whole struct open — can lead to misuse

Additional context

fo2rist avatar Jul 18 '22 18:07 fo2rist