Closed fo2rist closed 11 months ago
@fo2rist You should be able to use internal initializers if you import AwsAppSync using @testable
clause, eg:
@testable import AwsAppSync
I am using this approach to create eg. GraphQLResult objects
Thank you for opening this issue. AWS AppSync SDK for iOS entered maintenance mode in September 2023 and will receive no further updates as of September 2024.
Please use Amplify Swift going forward. For information on upgrading to Amplify Swift, refer to the Upgrade from AppSync SDK documentation.
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 ofGraphQLError
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 constructGraphQLError
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 ofGraphQLError
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