You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apollo should stores mutation variables in database using marshaller instead it seems like it is storing them by invoking toString() on them which causes it to store as object ref. This makes database grow with each mutation invocation with no apparent value. Check attached screenshot of table.
Issue seems to come from com.apollographql.apollo.api.ResponseField#asJsonValue. Ideally com.apollographql.apollo.api.Operation.Variables should implement some Marshaller interface which com.apollographql.apollo.api.ResponseField#asJsonValue can utilize.
Here is one of compact generated input file:
@Generated("Apollo GraphQL")
public final class UpdateStarredForThreadsInput {
private final Input<String> clientMutationId;
private final @NotNull String orgID;
private final boolean starred;
private final @NotNull List<String> threadIDs;
private final Input<String> uuid;
private volatile int $hashCode;
private volatile boolean $hashCodeMemoized;
UpdateStarredForThreadsInput(Input<String> clientMutationId, @NotNull String orgID,
boolean starred, @NotNull List<String> threadIDs, Input<String> uuid) {
this.clientMutationId = clientMutationId;
this.orgID = orgID;
this.starred = starred;
this.threadIDs = threadIDs;
this.uuid = uuid;
}
public InputFieldMarshaller marshaller() {
return new InputFieldMarshaller() {
@Override
public void marshal(InputFieldWriter writer) throws IOException {
if (clientMutationId.defined) {
writer.writeString("clientMutationId", clientMutationId.value);
}
writer.writeCustom("orgID", com.spruce.messenger.domain.apollo.type.CustomType.ID, orgID);
writer.writeBoolean("starred", starred);
writer.writeList("threadIDs", new InputFieldWriter.ListWriter() {
@Override
public void write(InputFieldWriter.ListItemWriter listItemWriter) throws IOException {
for (final String $item : threadIDs) {
listItemWriter.writeCustom(CustomType.ID, $item);
}
}
});
if (uuid.defined) {
writer.writeString("uuid", uuid.value);
}
}
};
}
}
The text was updated successfully, but these errors were encountered:
For GraphQL input types if they are involved in building cache key we were using plain `.toString` call.
With this commit we first serialize input type to map, resolve all variable references and sort by name, then serialize result map to json string.
Closesapollographql#977Closesapollographql#941
Apollo should stores mutation variables in database using marshaller instead it seems like it is storing them by invoking
toString()
on them which causes it to store as object ref. This makes database grow with each mutation invocation with no apparent value. Check attached screenshot of table.Issue seems to come from
com.apollographql.apollo.api.ResponseField#asJsonValue
. Ideallycom.apollographql.apollo.api.Operation.Variables
should implement someMarshaller
interface whichcom.apollographql.apollo.api.ResponseField#asJsonValue
can utilize.Here is one of compact generated input file:
The text was updated successfully, but these errors were encountered: