Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (ComposedComponent.getInitialProps) {
composedInitialProps = await ComposedComponent.getInitialProps(ctx);
}
if (!isServer) {
return {
...composedInitialProps,
environment: null,
};
}
let queryRecords = {};
const environment = initEnvironment();
const {query, variables} = options;
if (query) {
await fetchQuery(environment, query, variables);
queryRecords = environment
.getStore()
.getSource()
.toJSON();
}
return {
...composedInitialProps,
queryRecords,
environment,
};
};