aws-mobile-appsync-sdk-ios
aws-mobile-appsync-sdk-ios copied to clipboard
Make public constructor for GraphQLError
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