Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop stream response reader support #230

Merged

Conversation

sav007
Copy link
Contributor

@sav007 sav007 commented Feb 22, 2017

Closes #229

So ResponseJsonStreamReader is not entirely deleted as it's used to read response into Map (see com.apollographql.android.ResponseJsonStreamReader#buffer) from JsonReader.
But parsing response data is done via BufferedResponseReader. Now this is the only guy who can read Fields.

data = (T) responseStreamReader.nextObject(false, new ResponseJsonStreamReader.ObjectReader<Object>() {
          @Override public Object read(ResponseJsonStreamReader reader) throws IOException {
            Map<String, Object> buffer = reader.buffer();
            BufferedResponseReader bufferedResponseReader = new BufferedResponseReader(buffer, operation,
                customTypeAdapters);
            return responseFieldMapper.map(bufferedResponseReader);
          }
        });

com.apollographql.android.api.graphql.ResponseReader#read(com.apollographql.android.api.graphql.ResponseReader.ValueHandler, com.apollographql.android.api.graphql.Field...) will be removed in next PR as it requires changes to be made how we generate Mapper classes.

@sav007 sav007 merged commit e9c5ce1 into apollographql:master Feb 23, 2017
@sav007 sav007 deleted the feature-229/drop-streaming-reader-support branch February 23, 2017 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants