spherehq/sphere

View on GitHub
packages/platform/gatsby-ssr.js

Summary

Maintainability
A
1 hr
Test Coverage
import * as React from 'react'
 
import { ApolloProvider } from 'react-apollo'
 
import ApolloClient from 'apollo-boost'
import fetch from 'isomorphic-fetch'
 
import Layout from './src/components/layout'
 
const client = new ApolloClient({
uri: process.env.SPHERE_GRAPHQL_ENDPOINT,
fetch,
})
 
Similar blocks of code found in 2 locations. Consider refactoring.
export const wrapPageElement = ({ element, props }) => {
return (
<ApolloProvider client={client}>
<Layout {...props}>{element}</Layout>
</ApolloProvider>
)
}