Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function create(initialState = {}) {
return new GraphQLClient({
ssrMode: isServer,
url: 'https://rickandmortyapi.com/graphql',
cache: memCache({ initialState }),
fetch: typeof window !== 'undefined' ? fetch.bind() : unfetch, // eslint-disable-line
});
}
function create(initialState = {}) {
return new GraphQLClient({
ssrMode: typeof window === 'undefined',
url: 'https://api.graph.cool/simple/v1/cixmkt2ul01q00122mksg82pn',
cache: memCache({ initialState }),
fetch: typeof window !== 'undefined' ? fetch.bind() : unfetch, // eslint-disable-line
})
}
function create(initialState = {}) {
return new GraphQLClient({
ssrMode: typeof window === 'undefined',
url: process.env.DATENGUIDE_API,
cache: memCache({ initialState }),
fetch: typeof window !== 'undefined' ? fetch.bind() : unfetch // eslint-disable-line
})
}
import {
GraphQLClient,
ClientContext,
useQuery,
useMutation,
useManualQuery,
APIError
} from 'graphql-hooks'
interface Post {
id: string
title: string
url: string
}
const client = new GraphQLClient({
url: 'https://api.graph.cool/simple/v1/cjs4qo29b2w0c0130tfx6maca'
})
export const allPostsQuery = `
query {
allPosts(orderBy: createdAt_DESC, first: 20) {
id
title
url
}
}
`
const createPostMutation = `
mutation CreatePost($title: String!, $url: String!) {
createPost(title: $title, url: $url) {