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

Introduce explicit re-fetch query for mutation operation. #504

Merged
merged 15 commits into from
May 27, 2017
Prev Previous commit
Next Next commit
Merge branch 'master' into feature-452/refetch-query-prepare
  • Loading branch information
sav007 committed May 17, 2017
commit ed36b20c116648d2a7b9caaf894083e51dd72c55
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,24 @@ public ResponseFieldMapper<AllStarships.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public AllStarships build() {
return new AllStarships();
}
}

public static class Data implements Operation.Data {
private final Optional<AllStarships1> allStarships;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<R2> r2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.apollographql.apollo.api.Field;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.OperationName;
import com.apollographql.apollo.api.Query;
import com.apollographql.apollo.api.ResponseFieldMapper;
import com.apollographql.apollo.api.ResponseReader;
Expand Down Expand Up @@ -38,6 +39,13 @@ public final class TestQuery implements Query<TestQuery.Data, Optional<TestQuery

public static final String QUERY_DOCUMENT = OPERATION_DEFINITION;

private static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "TestQuery";
}
};

private final Operation.Variables variables;

public TestQuery() {
Expand All @@ -64,6 +72,24 @@ public ResponseFieldMapper<TestQuery.Data> responseFieldMapper() {
return new Data.Mapper();
}

public static Builder builder() {
return new Builder();
}

@Override
public OperationName name() {
return OPERATION_NAME;
}

public static final class Builder {
Builder() {
}

public TestQuery build() {
return new TestQuery();
}
}

public static class Data implements Operation.Data {
private final Optional<Hero> hero;

Expand Down Expand Up @@ -98,7 +124,7 @@ public boolean equals(Object o) {
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.hero == null) ? (that.hero == null) : this.hero.equals(that.hero));
return this.hero.equals(that.hero);
}
return false;
}
Expand All @@ -108,7 +134,7 @@ public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (hero == null) ? 0 : hero.hashCode();
h ^= hero.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
Expand Down Expand Up @@ -191,9 +217,9 @@ public boolean equals(Object o) {
}
if (o instanceof Hero) {
Hero that = (Hero) o;
return ((this.__typename == null) ? (that.__typename == null) : this.__typename.equals(that.__typename))
&& ((this.name == null) ? (that.name == null) : this.name.equals(that.name))
&& ((this.friendsConnection == null) ? (that.friendsConnection == null) : this.friendsConnection.equals(that.friendsConnection));
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name)
&& this.friendsConnection.equals(that.friendsConnection);
}
return false;
}
Expand All @@ -203,11 +229,11 @@ public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (__typename == null) ? 0 : __typename.hashCode();
h ^= __typename.hashCode();
h *= 1000003;
h ^= (name == null) ? 0 : name.hashCode();
h ^= name.hashCode();
h *= 1000003;
h ^= (friendsConnection == null) ? 0 : friendsConnection.hashCode();
h ^= friendsConnection.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
Expand Down Expand Up @@ -294,9 +320,9 @@ public boolean equals(Object o) {
}
if (o instanceof FriendsConnection) {
FriendsConnection that = (FriendsConnection) o;
return ((this.__typename == null) ? (that.__typename == null) : this.__typename.equals(that.__typename))
&& ((this.totalCount == null) ? (that.totalCount == null) : this.totalCount.equals(that.totalCount))
&& ((this.edges == null) ? (that.edges == null) : this.edges.equals(that.edges));
return this.__typename.equals(that.__typename)
&& this.totalCount.equals(that.totalCount)
&& this.edges.equals(that.edges);
}
return false;
}
Expand All @@ -306,11 +332,11 @@ public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (__typename == null) ? 0 : __typename.hashCode();
h ^= __typename.hashCode();
h *= 1000003;
h ^= (totalCount == null) ? 0 : totalCount.hashCode();
h ^= totalCount.hashCode();
h *= 1000003;
h ^= (edges == null) ? 0 : edges.hashCode();
h ^= edges.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
Expand Down Expand Up @@ -385,8 +411,8 @@ public boolean equals(Object o) {
}
if (o instanceof Edge) {
Edge that = (Edge) o;
return ((this.__typename == null) ? (that.__typename == null) : this.__typename.equals(that.__typename))
&& ((this.node == null) ? (that.node == null) : this.node.equals(that.node));
return this.__typename.equals(that.__typename)
&& this.node.equals(that.node);
}
return false;
}
Expand All @@ -396,9 +422,9 @@ public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (__typename == null) ? 0 : __typename.hashCode();
h ^= __typename.hashCode();
h *= 1000003;
h ^= (node == null) ? 0 : node.hashCode();
h ^= node.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
Expand Down Expand Up @@ -471,8 +497,8 @@ public boolean equals(Object o) {
}
if (o instanceof Node) {
Node that = (Node) o;
return ((this.__typename == null) ? (that.__typename == null) : this.__typename.equals(that.__typename))
&& ((this.name == null) ? (that.name == null) : this.name.equals(that.name));
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name);
}
return false;
}
Expand All @@ -482,9 +508,9 @@ public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (__typename == null) ? 0 : __typename.hashCode();
h ^= __typename.hashCode();
h *= 1000003;
h ^= (name == null) ? 0 : name.hashCode();
h ^= name.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.