This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gql from "graphql-tag"; | |
const UPDATE_APP_BAR_COLOR_SETTING_MUTATION = gql` | |
mutation updateAppBarColorSetting($setting: String!) { | |
updateAppBarColorSetting(setting: $setting) @client | |
} | |
`; | |
export default UPDATE_APP_BAR_COLOR_SETTING_MUTATION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [updateUserSetting] = useMutation( | |
UPDATE_APP_BAR_COLOR_SETTING_MUTATION, | |
{ | |
variables: { setting }, | |
update: cache => { | |
const data = cache.readQuery({ | |
query: APP_BAR_COLOR_SETTING_QUERY | |
}); | |
const dataClone = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useMutation } from "@apollo/react-hooks"; | |
import Button from "@material-ui/core/Button"; | |
import UPDATE_APP_BAR_COLOR_SETTING_MUTATION from "../graphql/UPDATE_APP_BAR_COLOR_SETTING_MUTATION"; | |
import APP_BAR_COLOR_SETTING_QUERY from "../graphql/APP_BAR_COLOR_SETTING_QUERY"; | |
function SettingsComponent({ setting }) { | |
const [updateUserSetting] = useMutation( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useQuery } from "@apollo/react-hooks"; | |
import AppBar from "@material-ui/core/AppBar"; | |
import Toolbar from "@material-ui/core/Toolbar"; | |
import Typography from "@material-ui/core/Typography"; | |
import IconButton from "@material-ui/core/IconButton"; | |
import MenuIcon from "@material-ui/icons/Menu"; | |
import SettingsComponent from "./components/SettingsComponent"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gql from "graphql-tag"; | |
const APP_BAR_COLOR_SETTING_QUERY = gql` | |
query appBarColorSetting { | |
appBarColorSetting @client { | |
id @client | |
name @client | |
setting @client | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"appBarColorSetting": { | |
"id": 1, | |
"name": "App Bar Color", | |
"setting": "primary", | |
"__typename": "AppBarColorSetting" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import gql from "graphql-tag"; | |
import { ApolloClient } from "apollo-client"; | |
import { ApolloProvider } from "@apollo/react-hooks"; | |
import { InMemoryCache } from "apollo-cache-inmemory"; | |
import App from "./App"; | |
import userSettings from "./userSettings"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ApolloServer, gql } = require("apollo-server"); | |
const typeDefs = gql` | |
interface UserSetting { | |
filler: Boolean! | |
} | |
type AppBarColorSetting implements UserSetting { | |
filler: Boolean! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from 'apollo-client' | |
import { ApolloLink } from 'apollo-link' | |
import { HttpLink } from 'apollo-link-http' | |
import { WebSocketLink } from 'apollo-link-ws' | |
import Cache from 'apollo-cache-inmemory' | |
import { getOperationAST } from 'graphql' | |
import Vue from 'vue' | |
import VueApollo from 'vue-apollo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
describe('Directive v-html', () => { | |
it('should render html', () => { | |
const vm = new Vue({ | |
template: '<div v-html="a"></div>', | |
data: { a: 'hello' } | |
}).$mount() | |
expect(vm.$el.innerHTML).toBe('hello') | |
}) |
NewerOlder