How to use the apollo-utilities.stripSymbols function in apollo-utilities

To help you get started, we’ve selected a few apollo-utilities examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / QueryManager / recycler.ts View on Github external
next: result => {
        count++;
        if (count === 1) {
          expect(result.data).toBeUndefined();
          expect(result.loading).toBe(true);
        }
        if (count === 2) {
          expect(result.loading).toBe(false);
          expect(stripSymbols(result.data)).toEqual(initialData);
          expect(stripSymbols(observable.getCurrentResult().data)).toEqual(
            initialData,
          );

          // step 2, recycle it
          observable.setOptions({
            fetchPolicy: 'standby',
            pollInterval: 0,
            fetchResults: false,
          });

          observableQueries.push({
            observableQuery: observable,
            subscription: observable.subscribe({}),
          });
github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / QueryManager / index.ts View on Github external
result => {
          expect(stripSymbols(result)).toEqual({
            data: data1,
            loading: false,
            networkStatus: NetworkStatus.ready,
            stale: false,
          });
        },
        result => {
github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / QueryManager / index.ts View on Github external
next: wrap(done, newResult => {
        const expectedResult = assign(
          { fromRx: true, loading: false, networkStatus: 7, stale: false },
          expResult,
        );
        expect(stripSymbols(newResult)).toEqual(expectedResult);
        done();
      }),
    });
github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / QueryManager / index.ts View on Github external
next: result => {
        try {
          expect(stripSymbols(result.data)).toEqual(data1);
          expect(stripSymbols(result.data)).toEqual(
            stripSymbols(observable.currentResult().data),
          );
          done();
        } catch (error) {
          done.fail(error);
        }
      },
      error: error => done.fail(error),
github apollographql / apollo-client / packages / apollo-client / src / __tests__ / client.ts View on Github external
subscribeAndCount(done, obs, (handleCount, result) => {
        const resultData = stripSymbols(result.data);
        if (handleCount === 1) {
          expect(resultData).toEqual(initialData);
        } else if (handleCount === 2) {
          expect(resultData).toEqual(networkFetch);
          done();
        }
      });
    });
github apollographql / apollo-client / packages / apollo-cache-inmemory / src / __tests__ / readFromStore.ts View on Github external
const store = defaultNormalizedCacheFactory({
      ROOT_QUERY: {
        id: 'abcd',
        nullField: null,
        'numberField({"floatArg":3.14,"intArg":0})': 5,
        'stringField({"arg":"This is a default string!"})': 'Heyo',
      },
    });

    const result = reader.readQueryFromStore({
      store,
      query,
      variables,
    });

    expect(stripSymbols(result)).toEqual({
      id: 'abcd',
      nullField: null,
      numberField: 5,
      stringField: 'Heyo',
    });
  });
github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / ObservableQuery.ts View on Github external
data: dataOne,
              loading: false,
              networkStatus: 7,
              stale: false,
            });
            queryManager.mutate({
              mutation,
              optimisticResponse,
              updateQueries,
            });
          } else if (count === 2) {
            expect(stripSymbols(result.data.people_one)).toEqual(
              optimisticResponse,
            );
          } else if (count === 3) {
            expect(stripSymbols(result.data.people_one)).toEqual(mutationData);
            done();
          }
        });
      });
github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / ObservableQuery.ts View on Github external
subscribeAndCount(done, observable, () => {
        expect(stripSymbols(observable.getCurrentResult())).toEqual({
          data: dataOne,
          loading: false,
          networkStatus: 7,
          partial: false,
        });
        done();
      });
github apollographql / apollo-client / packages / apollo-client / src / __tests__ / client.ts View on Github external
const withDefault = client.query({ query }).then(actualResult => {
      return expect(stripSymbols(actualResult.data)).toEqual(result);
    });
github apollographql / apollo-client / packages / apollo-client / src / core / __tests__ / QueryManager / live.ts View on Github external
next: result => {
        count++;
        if (count === 1) {
          expect(stripSymbols(result.data)).toEqual(initialData);
          setTimeout(() => {
            link.simulateResult({ result: { data: laterData } });
          }, 10);
        }
        if (count === 2) {
          expect(stripSymbols(result.data)).toEqual(laterData);
          done();
        }
      },
      error: e => {