query {
authors {
name
}
}
{
"data": {
"authors": [
{
"name": "Natalia"
}
]
}
}
query {
authors {
name
age
}
}
{
"data": {
"authors": [
{
"name": "Natalia",
"age": 35
}
]
}
}
[
{
"id": 1296269,
"name": "docs",
"full_name": "NataliaTepluhina/docs",
...
},
{
"id": 1296212,
"name": "website",
"full_name": "NataliaTepluhina/website",
...
}
]
{
"C": 78769,
"JavaScript": 78123
"Python": 7769,
}
[
{
"id": 1296212,
"name": "docs",
"full_name": "NataliaTepluhina/docs",
"owner": {
"login": "NataliaTepluhina",
...
},
}
]
query {
user(login: "NataliaTepluhina") {
repositories(first: 10) {
nodes {
name
forks (first: 10) {
nodes {
name
}
}
languages (first: 10) {
nodes {
name
}
}
}
}
}
}
type User {
name: String!;
age: Int;
}
type Comment {
title: String!;
author: User!;
}
npm install --save vue-apollo graphql apollo-boost
## OR
yarn add vue-apollo graphql apollo-boost
import ApolloClient from 'apollo-boost'
const apolloClient = new ApolloClient({
// You should use an absolute URL here
uri: 'https://myGraphQL.com/graphql'
})
const apolloProvider = new VueApollo({
defaultClient: apolloClient,
})
Vue.use(VueApollo)
new Vue({
el: '#app',
apolloProvider,
render: h => h(App),
})
vue add apollo