This file contains hidden or 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-if="user"> | |
| <h5>{{ user.id }}</h5> | |
| <h5>{{ user.name }}</h5> | |
| <h5>{{ user.age }}</h5> | |
| </div> | |
| </div> | |
| </template> |
This file contains hidden or 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> | |
| <h2>유저 리스트</h2> | |
| <div v-for="user in userList" :key="user.id"> | |
| {{ user.id }} {{ user.name }} {{ user.age }} | |
| </div> | |
| </div> | |
| </template> | |
| <script lang="ts"> |
This file contains hidden or 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> | |
| <h2>유저 리스트</h2> | |
| <div v-for="user in users" :key="user.id"> | |
| {{ user.id }} {{ user.name }} {{ user.age }} | |
| </div> | |
| </div> | |
| </template> | |
| <script lang="ts"> |
This file contains hidden or 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 { createHttpLink } from "apollo-link-http"; | |
| import { InMemoryCache } from "apollo-cache-inmemory"; | |
| import { onError } from "apollo-link-error"; | |
| import { ApolloLink } from "apollo-link"; | |
| const errorLink = onError(({ operation, graphQLErrors, networkError }) => { | |
| if (graphQLErrors) | |
| graphQLErrors.forEach(({ message, locations, path }) => { | |
| console.error( |
This file contains hidden or 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 { createHttpLink } from "apollo-link-http"; | |
| import { InMemoryCache } from "apollo-cache-inmemory"; | |
| const httpLink = createHttpLink({ | |
| uri: "http://localhost:4000/graphql", | |
| }); | |
| const cache = new InMemoryCache(); |
This file contains hidden or 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 VueApollo from "vue-apollo"; | |
| import { apolloClient } from "./apolloClient"; | |
| Vue.config.productionTip = false; | |
| const apolloProvider = new VueApollo({ |