use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method unregisterPrefetchCall.
/**
* <p>Removes provided {@link ApolloPrefetch} that finished his execution, if it is found, else throws an
* {@link AssertionError}.</p>
*
* If the removal operation is successful and no active running calls are found, then the registered
* {@link ApolloCallTracker#idleResourceCallback} is invoked.
*
* <p><b>Note</b>: This method needs to be called right after a prefetch call is completed (whether successful or
* failed).</p>
*/
void unregisterPrefetchCall(@Nonnull ApolloPrefetch apolloPrefetch) {
checkNotNull(apolloPrefetch, "apolloPrefetch == null");
OperationName operationName = apolloPrefetch.operation().name();
unregisterCall(activePrefetchCalls, operationName, apolloPrefetch);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method registerMutationCall.
/**
* <p>Adds provided {@link ApolloMutationCall} that is currently in progress.</p>
*
* <p><b>Note</b>: This method needs to be called right before an apolloCall is executed.</p>
*/
void registerMutationCall(@Nonnull ApolloMutationCall apolloMutationCall) {
checkNotNull(apolloMutationCall, "apolloMutationCall == null");
OperationName operationName = apolloMutationCall.operation().name();
registerCall(activeMutationCalls, operationName, apolloMutationCall);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method unregisterMutationCall.
/**
* <p>Removes provided {@link ApolloMutationCall} that finished his execution, if it is found, else throws an
* {@link AssertionError}.</p>
*
* If the removal operation is successful and no active running calls are found, then the registered
* {@link ApolloCallTracker#idleResourceCallback} is invoked.
*
* <p><b>Note</b>: This method needs to be called right after an apolloCall is completed (whether successful or
* failed).</p>
*/
void unregisterMutationCall(@Nonnull ApolloMutationCall apolloMutationCall) {
checkNotNull(apolloMutationCall, "apolloMutationCall == null");
OperationName operationName = apolloMutationCall.operation().name();
unregisterCall(activeMutationCalls, operationName, apolloMutationCall);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ResponseFetcherTest method setUp.
@Before
public void setUp() {
okHttpClient = new OkHttpClient.Builder().build();
emptyQuery = new Query() {
OperationName operationName = new OperationName() {
@Override
public String name() {
return "emptyQuery";
}
};
@Override
public String queryDocument() {
return "";
}
@Override
public Variables variables() {
return EMPTY_VARIABLES;
}
@Override
public ResponseFieldMapper<Data> responseFieldMapper() {
return new ResponseFieldMapper<Data>() {
@Override
public Data map(ResponseReader responseReader) {
return null;
}
};
}
@Nonnull
@Override
public OperationName name() {
return operationName;
}
@Nonnull
@Override
public String operationId() {
return "";
}
@Override
public Object wrapData(Data data) {
return data;
}
};
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method registerQueryCall.
/**
* <p>Adds provided {@link ApolloQueryCall} that is currently in progress.</p>
*
* <p><b>Note</b>: This method needs to be called right before an apolloCall is executed.</p>
*/
void registerQueryCall(@Nonnull ApolloQueryCall apolloQueryCall) {
checkNotNull(apolloQueryCall, "apolloQueryCall == null");
OperationName operationName = apolloQueryCall.operation().name();
registerCall(activeQueryCalls, operationName, apolloQueryCall);
}
Aggregations