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
// @flow/* global __DEV__ */importfsfrom'fs';importpathfrom'path';importEasyGraphQLTesterfrom'easygraphql-tester';import{installRelayDevTools}from'relay-devtools';import{Environment,Network,RecordSource,Store}from'relay-runtime';importRelayNetworkLoggerfrom'relay-runtime/lib/RelayNetworkLogger';importcacheHandlerfrom'./cacheHandler';import{fixtures}from'./fixture'constschema=fs.readFileSync(path.join(__dirname,'..','..','data','schema.graphql'),'utf8');consttester=newEasyGraphQLTester(schema);letnetworkQuery=cacheHandlerif(__DEV__){installRelayDevTools();networkQuery=RelayNetworkLogger.wrapFetch(cacheHandler)}// If it is a test set this variable or process.env.NODE_ENV === 'test'if(__TEST__){networkQuery=fetchQuery}functionfetchQuery(operation,variables){constmockedQuery=tester.mock({query: operation.text,
variables,fixture: fixtures[operation.name]})console.log('Mocked Query: --->',mockedQuery);returnmockedQuery.json()}constnetwork=Network.create(networkQuery);constsource=newRecordSource();conststore=newStore(source);// export const inspector = new RecordSourceInspector(source);constenv=newEnvironment({
network,
store,});exportdefaultenv;
The text was updated successfully, but these errors were encountered:
https://gist.github.com/estrada9166/3cc30cece4d159228439298af7b41408
The text was updated successfully, but these errors were encountered: