Skip to content

Instantly share code, notes, and snippets.

View akshar07's full-sized avatar

Akshar Takle akshar07

View GitHub Profile
import React from "react"
import { useMutation, useQuery } from "@apollo/react-hooks";
import gql from "graphql-tag";
const toggleAppTheme = gql`
mutation updateAppState{
isDarkModeEnabled
}
`;
import React from "react"
import { useMutation } from "@apollo/react-hooks";
import gql from "graphql-tag";
const TOGGLE_THEME = gql`
mutation updateAppState @client {
isDarkModeEnabled
}
`;
import gql from 'graphql-tag';
const getAppState = gql`
query {
state @client {
appState {
isDarkModeEnabled
}
}
}
import gql from 'graphql-tag';
const typeDefs = gql `
type appState {
isDarkModeEnabled: Boolean
}
`;
export default typeDefs;
import gql from 'graphql-tag';
const typeDefs = gql `
extend type appState {
isDarkModeEnabled: Boolean
}
`;
export default typeDefs;
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
// typedefs and resolvers
import StateResolvers from './resolvers';
import typeDefs from './typeDefs';
export function createClient(): ApolloClient<NormalizedCacheObject> {
const cache = new InMemoryCache();
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
// typedefs and resolvers
import StateResolvers from './resolvers';
import typeDefs from './state';
export function createClient(): ApolloClient<NormalizedCacheObject> {
const cache = new InMemoryCache();
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
// typedefs and resolvers
import StateResolvers from 'app/shared/graphql/state/resolvers';
import typeDefs from './state';
export function createClient(): ApolloClient<NormalizedCacheObject> {
const cache = new InMemoryCache();
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import fetch from 'node-fetch';
// typedefs and resolvers
import StateResolvers from 'app/shared/graphql/state/resolvers';
import typeDefs from './state';
export function createClient(): ApolloClient<NormalizedCacheObject> {
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import fetch from 'node-fetch';
// typedefs and resolvers
import StateResolvers from 'app/shared/graphql/state/resolvers';
import typeDefs from './state';
export function createClient(): ApolloClient<NormalizedCacheObject> {