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

Add LinkedHashMap type support to RecordFieldJsonAdapter #1010

Merged

Conversation

tuncaulubilge
Copy link
Contributor

@tuncaulubilge tuncaulubilge commented Jul 25, 2018

See: #1001

RecordFieldJsonAdapter does not support LinkedHashMap at the moment, so it's unable to parse json objects if no custom types are defined. This bug is blocking SqlNormalisedCache from persisting these objects to the database.

Copy link
Contributor

@sav007 sav007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for looking into this issue, just 2 comments: first regarding use generic type Map and second is could you please add test to address this issue in com.apollographql.apollo.cache.normalized.RecordFieldAdapterTest.

@@ -84,6 +85,15 @@ private static void writeJsonValue(Object value, JsonWriter jsonWriter) throws I
writeJsonValue(item, jsonWriter);
}
jsonWriter.endArray();
} else if (value instanceof LinkedHashMap) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use more generic type Map instead as we can easily change internal logic and use other implementation of Map in future.

@sav007 sav007 merged commit 9e4d257 into apollographql:master Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants