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
<router-link to="/">Home</router-link>| | |
<router-link to="/addpost">New Post</router-link> |
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"; | |
import VueRouter from "vue-router"; | |
import Home from "../views/Home.vue"; | |
import AddPost from "../views/AddPost.vue"; | |
Vue.use(VueRouter); | |
const routes = [ | |
{ | |
path: "/", |
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> | |
<div style="text-align: left; width:800px; margin:0 auto;"> | |
<strong>Title</strong> | |
</div> | |
<div style="text-align: center; width:800px; margin:0 auto;"> | |
<input style="width:800px" type="text" id="title" name="title" value="" v-model="title" /> | |
</div> | |
<br /> | |
<div style="text-align: left; width:800px; margin:0 auto;"> |
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> | |
<div v-for="post in Posts" :key="post.id"> | |
<div style="font-size: 20px; font-weight: 700;">{{ post.title }}</div> | |
<div style="text-align: justify; width:800px; margin:0 auto;"> | |
<p> | |
{{ post.description }} | |
</p> | |
</div> | |
<div style="text-align: right; width:800px; margin:0 auto;"> |
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> | |
<div v-for="post in Posts" :key="post.id"> | |
<div style="font-size: 20px; font-weight: 700;">{{ post.title }}</div> | |
<div style="text-align: justify; width:800px; margin:0 auto;"> | |
<p> | |
{{ post.description }} | |
</p> | |
</div> | |
<div style="text-align: right; width:800px; margin:0 auto;"> |
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"; | |
import App from "./App.vue"; | |
import router from "./router"; | |
import store from "./store"; | |
//import apolloclient and vueapollo | |
import ApolloClient from "apollo-boost"; | |
import VueApollo from "vue-apollo"; | |
Vue.config.productionTip = false; | |
// define const apolloClient to set graphql api url |
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
mutation { | |
deletePost(id:1) | |
} |
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
mutation { | |
updatePost( | |
id:2, | |
title: "Mi segundo Post", | |
description: "en mi primer post tengo que la vida no es facil", | |
createDate:"26-09-2019", | |
author:"Jesus GIlbert" | |
) | |
} |
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
mutation { | |
createPost(title: "Mi primer Post", description: "en mi primer post tengo que la vida no es facil", createDate:"25-09-2019",author:"Jesus GIlbert") { | |
id, | |
title, | |
description, | |
createDate, | |
author | |
} | |
} |
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
query{ | |
Posts{ | |
id, | |
title, | |
description, | |
createDate, | |
author | |
} | |
} |
NewerOlder