use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method registerQueryWatcher.
/**
* <p>Adds provided {@link ApolloQueryWatcher} that is currently in progress.</p>
*
* <p><b>Note</b>: This method needs to be called right before
* {@link ApolloQueryWatcher#enqueueAndWatch(ApolloCall.Callback)}.</p>
*/
void registerQueryWatcher(@Nonnull ApolloQueryWatcher queryWatcher) {
checkNotNull(queryWatcher, "queryWatcher == null");
OperationName operationName = queryWatcher.operation().name();
registerCall(activeQueryWatchers, operationName, queryWatcher);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method unregisterQueryWatcher.
/**
* <p>Removes provided {@link ApolloQueryWatcher} 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 unregisterQueryWatcher(@Nonnull ApolloQueryWatcher queryWatcher) {
checkNotNull(queryWatcher, "queryWatcher == null");
OperationName operationName = queryWatcher.operation().name();
unregisterCall(activeQueryWatchers, operationName, queryWatcher);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method unregisterQueryCall.
/**
* <p>Removes provided {@link ApolloQueryCall} 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 unregisterQueryCall(@Nonnull ApolloQueryCall apolloQueryCall) {
checkNotNull(apolloQueryCall, "apolloQueryCall == null");
OperationName operationName = apolloQueryCall.operation().name();
unregisterCall(activeQueryCalls, operationName, apolloQueryCall);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloCallTracker method registerPrefetchCall.
/**
* <p>Adds provided {@link ApolloPrefetch} that is currently in progress.</p>
*
* <p><b>Note</b>: This method needs to be called right before a prefetch call is executed.</p>
*/
void registerPrefetchCall(@Nonnull ApolloPrefetch apolloPrefetch) {
checkNotNull(apolloPrefetch, "apolloPrefetch == null");
OperationName operationName = apolloPrefetch.operation().name();
registerCall(activePrefetchCalls, operationName, apolloPrefetch);
}
use of com.apollographql.apollo.api.OperationName in project apollo-android by apollographql.
the class ApolloExceptionTest method setUp.
@Before
public void setUp() {
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).okHttpClient(new OkHttpClient.Builder().connectTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS).readTimeout(TIMEOUT_SECONDS, TimeUnit.SECONDS).build()).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;
}
};
}
Aggregations