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
<template> | |
<div>{{book.name}} by {{book.author}}</div> | |
</template> | |
<script> | |
export default { | |
name: 'BookItem', | |
props: ['book'] | |
} | |
</script> |
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
// 1 | |
import { ApolloClient } from 'apollo-client' | |
import { HttpLink } from 'apollo-link-http' | |
import { InMemoryCache } from 'apollo-cache-inmemory' | |
import Vue from 'vue' | |
// 2 | |
import VueApollo from 'vue-apollo' | |
import App from './App' |
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
<template> | |
<div id="app" class="background"> | |
<div > | |
<h1> Books I've Read</h1> | |
<book-list></book-list> | |
</div> | |
</div> | |
</template> | |
<script> |
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
<template> | |
<div id="app" class="background"> | |
<div > | |
<h1> Books I've Read</h1> | |
<book-list></book-list> | |
<br> | |
<button | |
type="button" | |
class="btn" | |
@click="showModal" |
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' | |
export const ALL_BOOKS_QUERY = gql` | |
query books { | |
books { | |
id | |
author | |
name | |
} | |
} |
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
<script> | |
import { ADD_BOOK_MUTATION } from "../constants/graphql"; | |
export default { | |
name: "modal", | |
data: () => ({ | |
author: '', | |
name: '', | |
}), | |
methods: { |
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 { WebSocketLink } from 'apollo-link-ws'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { split } from 'apollo-link'; | |
import { getMainDefinition } from 'apollo-utilities'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import Vue from 'vue' | |
import VueApollo from 'vue-apollo' | |
import App from './App' |
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
// CommitChart.js | |
import { HorizontalBar, mixins } from 'vue-chartjs' | |
const { reactiveProp } = mixins | |
export default { | |
extends: HorizontalBar, | |
mixins: [reactiveProp], | |
props: { | |
chartData: { |
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' | |
export const ADD_VOTE_MUTATION = gql` | |
mutation updateVotes($id: Int!) { | |
update_characters(where: {id: {_eq: $id}}, | |
_inc: {votes: 1}) { | |
affected_rows | |
} | |
} | |
`; |
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
<template> | |
<div id="app"> | |
<div class="container"> | |
<div class="row"> | |
<div class="column"> | |
<h2>Who Might Die ⚔️</h2> | |
</div> | |
<div class="column"> | |
<h2 | |
v-if="loading" |
OlderNewer