Currently there's no way of creating a GraphQLResult due to every initialiser being internal.
GraphQLResult<Query.Data>(
data: data,
errors: nil,
source: .cache,
dependentKeys: nil
)
Fails with message _Cannot convert value of type 'Query.Data?' to expected argument type '_?'_
and
try GraphQLResponse(operation: query, body: json).parseResult()
Fails due to parseResult() being internal
Reading the threads it's clear to me that at least one of those methods was public before.
What should be the proper way to initialise a custom GraphQLResult?
+1
Can you explain what your use case for this is? GraphQLResult wasn't meant to be directly instantiated, so there might be a better way of accomplishing what you intend to do.
I want to mock the return value of the resultHandler: OperationResultHandler<Query>?
+1
Having an initialiser I can create my own responses in a middleware, as, for example, return a valid manually cached result when offline.
+1
+1
+1
+1
This was released with 0.11.1!
Most helpful comment
+1