Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import gql from 'graphql-tag';
import ApolloClient from 'apollo-boost';
import traverse from 'traverse';
import cloneDeep from 'lodash.clonedeep';
import { StaticQuery } from 'gatsby';
import PropTypes from 'prop-types';
// Allow string OR patched queries format (in development)
if (StaticQuery && typeof StaticQuery === 'object' && StaticQuery.propTypes) {
StaticQuery.propTypes.query = PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({
id: PropTypes.string.isRequired,
source: PropTypes.string.isRequired,
})
]).isRequired;
}
const options = new Map();
export const getOptions = (name) => {
if (!options.has(name)) {
if (typeof window !== 'undefined') {
setOptions(name, window.___graphqlUniversal[name])
}
import React from 'react';
import gql from 'graphql-tag';
import ApolloClient from 'apollo-boost';
import traverse from 'traverse';
import cloneDeep from 'lodash.clonedeep';
import { StaticQuery } from 'gatsby';
import PropTypes from 'prop-types';
// Allow string OR patched queries format (in development)
if (StaticQuery && typeof StaticQuery === 'object' && StaticQuery.propTypes) {
StaticQuery.propTypes.query = PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({
id: PropTypes.string.isRequired,
source: PropTypes.string.isRequired,
})
]).isRequired;
}
const options = new Map();
export const getOptions = (name) => {
if (!options.has(name)) {
if (typeof window !== 'undefined') {
setOptions(name, window.___graphqlUniversal[name])
}
}