awslabs / awslabs/aws-mobile-appsync-sdk-android

How to create a custom SomeClass.Data found in GraphQLCall.Callback<SomeClass.Data>() { onResponse(Response<SomeClass.Data>) { ... } } using custom json string?

Open
#271 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
106
Forks
56
PR merge metrics
No merged PRs in 30d

Description

Idea is to validate the code written in the app works with different json responses, a lot similar to unit test but this is to assist QA with actual testing when the backend services is not ready. Instead of getting a `Response`/`Response` through a network/GraphQL call, eliminate the call and create a custom `Response` or `SomeClass.Data` and provide that as the outcome of the call.

In iOS SDK, there is a constructor in `SomeClass.Data(snapshot: [String: Any?])`, which allows the developer to create a custom class from json response. But I couldn't find anything similar to it in android SDK. Please let me know if that exist in Android.

If above process is not viable, is there a way to override the body of a json response in GraphQL call with custom json response (body) using an interceptor or something?

Contributor guide

Open the contributing guide

Research direction

The request concerns GraphQLCall.Callback> in the Android SDK and compares it with iOS Data(snapshot:). Start by checking the Android SDK APIs and any interceptor or response-construction entry points; determine whether custom JSON can be supplied without a network call. Done means a documented, reproducible supported path, or a clearly scoped feature request if none exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, aws, graphql, java
Domain
api, mobile
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.