-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBL-1908 && MBL-1911: Migration to Apollo3 (#2182)
- Loading branch information
Showing
87 changed files
with
1,696 additions
and
1,781 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2014150921 | ||
2014150925 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.26.2 | ||
3.28.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/external/java/com/kickstarter/ExternalApplicationModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
mutation triggerThirdPartyEvent ($triggerThirdPartyEventInput: TriggerThirdPartyEventInput!) { | ||
triggerThirdPartyEvent(input: $triggerThirdPartyEventInput) { | ||
message | ||
success | ||
} | ||
} | ||
#mutation triggerThirdPartyEvent ($triggerThirdPartyEventInput: TriggerThirdPartyEventInput!) { | ||
# triggerThirdPartyEvent(input: $triggerThirdPartyEventInput) { | ||
# message | ||
# success | ||
# } | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/kickstarter/features/pledgedprojectsoverview/data/PPOCardFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
app/src/main/java/com/kickstarter/libs/graphql/DateAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
package com.kickstarter.libs.graphql | ||
|
||
import com.apollographql.apollo.api.CustomTypeAdapter | ||
import com.apollographql.apollo.api.CustomTypeValue | ||
import com.apollographql.apollo3.api.Adapter | ||
import com.apollographql.apollo3.api.CustomScalarAdapters | ||
import com.apollographql.apollo3.api.json.JsonReader | ||
import com.apollographql.apollo3.api.json.JsonWriter | ||
import java.text.ParseException | ||
import java.text.SimpleDateFormat | ||
import java.util.Date | ||
import java.util.Locale | ||
|
||
class DateAdapter : CustomTypeAdapter<Date> { | ||
class DateAdapter : Adapter<Date> { | ||
|
||
private val DATE_FORMAT = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) | ||
|
||
override fun encode(value: Date): CustomTypeValue<*> { | ||
return CustomTypeValue.GraphQLString(DATE_FORMAT.format(value)) | ||
} | ||
|
||
override fun decode(value: CustomTypeValue<*>): Date { | ||
try { | ||
return DATE_FORMAT.parse(value.value.toString()) | ||
override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): Date { | ||
return try { | ||
reader.nextString()?.let { DATE_FORMAT.parse(it) } ?: Date() | ||
} catch (exception: ParseException) { | ||
throw RuntimeException(exception) | ||
} | ||
} | ||
|
||
override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: Date) { | ||
writer.value(DATE_FORMAT.format(value)) | ||
} | ||
} |
28 changes: 18 additions & 10 deletions
28
app/src/main/java/com/kickstarter/libs/graphql/DateTimeAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
package com.kickstarter.libs.graphql | ||
|
||
import com.apollographql.apollo.api.CustomTypeAdapter | ||
import com.apollographql.apollo.api.CustomTypeValue | ||
import com.apollographql.apollo3.api.Adapter | ||
import com.apollographql.apollo3.api.CustomScalarAdapters | ||
import com.apollographql.apollo3.api.json.JsonReader | ||
import com.apollographql.apollo3.api.json.JsonWriter | ||
import org.joda.time.DateTime | ||
import org.joda.time.DateTimeZone | ||
import java.text.ParseException | ||
|
||
class DateTimeAdapter : CustomTypeAdapter<DateTime> { | ||
|
||
override fun encode(value: DateTime): CustomTypeValue<*> { | ||
return CustomTypeValue.GraphQLNumber(value.toString().toLong() / 1000L) | ||
} | ||
class DateTimeAdapter : Adapter<DateTime> { | ||
|
||
override fun decode(value: CustomTypeValue<*>): DateTime { | ||
override fun fromJson( | ||
reader: JsonReader, | ||
customScalarAdapters: CustomScalarAdapters | ||
): DateTime { | ||
try { | ||
return DateTime(java.lang.Long.valueOf(value.value.toString().toLong() * 1000L), DateTimeZone.UTC) | ||
return DateTime(java.lang.Long.valueOf(reader.nextString()!!.toLong() * 1000L), DateTimeZone.UTC) | ||
} catch (exception: ParseException) { | ||
throw RuntimeException(exception) | ||
} | ||
} | ||
|
||
override fun toJson( | ||
writer: JsonWriter, | ||
customScalarAdapters: CustomScalarAdapters, | ||
value: DateTime | ||
) { | ||
writer.value(value.toString().toLong() / 1000L) | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
app/src/main/java/com/kickstarter/libs/graphql/EmailAdapter.kt
This file was deleted.
Oops, something went wrong.
27 changes: 18 additions & 9 deletions
27
app/src/main/java/com/kickstarter/libs/graphql/Iso8601DateTimeAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
package com.kickstarter.libs.graphql | ||
|
||
import com.apollographql.apollo.api.CustomTypeAdapter | ||
import com.apollographql.apollo.api.CustomTypeValue | ||
import com.apollographql.apollo3.api.Adapter | ||
import com.apollographql.apollo3.api.CustomScalarAdapters | ||
import com.apollographql.apollo3.api.json.JsonReader | ||
import com.apollographql.apollo3.api.json.JsonWriter | ||
import org.joda.time.DateTime | ||
import java.text.ParseException | ||
|
||
class Iso8601DateTimeAdapter : CustomTypeAdapter<DateTime> { | ||
class Iso8601DateTimeAdapter : Adapter<DateTime> { | ||
|
||
override fun encode(value: DateTime): CustomTypeValue<*> { | ||
return CustomTypeValue.GraphQLString(value.toString()) | ||
} | ||
|
||
override fun decode(value: CustomTypeValue<*>): DateTime { | ||
override fun fromJson( | ||
reader: JsonReader, | ||
customScalarAdapters: CustomScalarAdapters | ||
): DateTime { | ||
try { | ||
return DateTime.parse(value.value.toString()) | ||
return DateTime.parse(reader.nextString()) | ||
} catch (exception: ParseException) { | ||
throw RuntimeException(exception) | ||
} | ||
} | ||
|
||
override fun toJson( | ||
writer: JsonWriter, | ||
customScalarAdapters: CustomScalarAdapters, | ||
value: DateTime | ||
) { | ||
writer.value(value.toString()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/kickstarter/libs/utils/SharedFunctions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/kickstarter/mock/factories/CheckoutDataFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.