Skip to content

Commit 6732878

Browse files
committed
Initial commit
0 parents  commit 6732878

15 files changed

+8840
-0
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"@vue/app"
4+
]
5+
}

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

.eslintrc.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
`plugin:vue/recommended`,
5+
`@avalanche/eslint-config`,
6+
],
7+
rules: {
8+
'no-console': process.env.NODE_ENV === `production` ? `error` : `warn`,
9+
'no-debugger': process.env.NODE_ENV === `production` ? `error` : `warn`,
10+
'vue/component-name-in-template-casing': [`error`,
11+
`PascalCase`,
12+
],
13+
'vue/no-v-html': false,
14+
'vue/html-closing-bracket-spacing': [`error`, {
15+
startTag: `never`,
16+
endTag: `never`,
17+
selfClosingTag: `never`,
18+
}],
19+
},
20+
parserOptions: {
21+
parser: `babel-eslint`,
22+
},
23+
};

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Numerous always-ignore extensions
2+
*.diff
3+
*.err
4+
*.log
5+
*.orig
6+
*.rej
7+
*.swo
8+
*.swp
9+
*.tgz
10+
*.vi
11+
*.zip
12+
*~
13+
14+
# OS or Editor folders
15+
._*
16+
.cache
17+
.DS_Store
18+
.idea
19+
.project
20+
.settings
21+
.tmproj
22+
*.esproj
23+
*.sublime-project
24+
*.sublime-workspace
25+
nbproject
26+
Thumbs.db
27+
28+
# Folders to ignore
29+
dist/*
30+
node_modules

.postcssrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"plugins": {
3+
"autoprefixer": {}
4+
}
5+
}

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# How to Use GraphQL with Vue Apollo Components and Netlify Functions
2+
3+
[![Patreon](https://img.shields.io/badge/patreon-donate-blue.svg)](https://www.patreon.com/maoberlehner)
4+
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/maoberlehner)
5+
6+
This is an example project for the following article: [How to Use GraphQL with Vue Apollo Components and Netlify Functions](https://markus.oberlehner.net/blog/how-to-use-graphql-with-vue-apollo-components-and-netlify-functions/)
7+
8+
## Build Setup
9+
10+
```bash
11+
# Install dependencies.
12+
npm install
13+
14+
# Serve with hot reload.
15+
npm run serve
16+
17+
# Build for production with minification.
18+
npm run build
19+
```
20+
21+
## About
22+
23+
### Author
24+
25+
Markus Oberlehner
26+
Website: https://markus.oberlehner.net
27+
Twitter: https://twitter.com/MaOberlehner
28+
PayPal.me: https://paypal.me/maoberlehner
29+
Patreon: https://www.patreon.com/maoberlehner
30+
31+
### License
32+
33+
MIT

package.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "how-to-use-graphql-with-vue-apollo-components-and-netlify-functions",
3+
"version": "0.1.0",
4+
"author": "Markus Oberlehner",
5+
"homepage": "https://github.com/maoberlehner/how-to-use-graphql-with-vue-apollo-components-and-netlify-functions",
6+
"license": "MIT",
7+
"private": true,
8+
"scripts": {
9+
"serve": "vue-cli-service serve",
10+
"build": "vue-cli-service build",
11+
"lint": "vue-cli-service lint"
12+
},
13+
"dependencies": {
14+
"@avalanche/generic-box-sizing-reset": "^4.0.0-alpha.5",
15+
"@avalanche/object-container": "^4.0.0-alpha.8",
16+
"@avalanche/object-vertical-spacing": "^4.0.0-alpha.5",
17+
"@avalanche/setting-spacings": "^4.0.0-alpha.6",
18+
"@vue/cli-plugin-babel": "^3.3.0",
19+
"@vue/cli-service": "^3.3.0",
20+
"node-sass": "^4.11.0",
21+
"node-sass-magic-importer": "^5.3.0",
22+
"reset-css": "^4.0.1",
23+
"sass-loader": "^7.1.0",
24+
"vue": "^2.5.22",
25+
"vue-template-compiler": "^2.5.22"
26+
},
27+
"devDependencies": {
28+
"@avalanche/eslint-config": "^3.0.0",
29+
"@vue/cli-plugin-eslint": "^3.3.0",
30+
"eslint-plugin-import": "^2.14.0",
31+
"eslint-plugin-vue": "^5.1.0"
32+
},
33+
"browserslist": [
34+
">0.25%",
35+
"not ie 10",
36+
"not op_mini all"
37+
]
38+
}

public/favicon.ico

1.12 KB
Binary file not shown.

public/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>How to Use GraphQL with Vue Apollo Components and Netlify Functions</title>
8+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
9+
</head>
10+
11+
<body>
12+
<div id="app"></div>
13+
<!-- built files will be auto injected -->
14+
</body>
15+
</html>

src/App.vue

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<div class="App o-container o-container--s o-vertical-spacing o-vertical-spacing--xl">
3+
<h1>How to Use GraphQL with Vue Apollo Components and Netlify Functions</h1>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: `App`,
10+
};
11+
</script>
12+
13+
<style lang="scss">
14+
@import './assets/scss/settings/**/*';
15+
@import './assets/scss/generic/**/*';
16+
@import '{
17+
.o-container,
18+
.o-container--s,
19+
} from ~@avalanche/object-container';
20+
@import '{
21+
.o-vertical-spacing,
22+
.o-vertical-spacing--xl,
23+
} from ~@avalanche/object-vertical-spacing';
24+
25+
.App {
26+
padding-top: setting-spacing(xl);
27+
padding-bottom: setting-spacing(xl);
28+
29+
h1 {
30+
text-align: center;
31+
}
32+
}
33+
</style>

src/assets/scss/generic/_base.scss

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@import '~@avalanche/generic-box-sizing-reset';
2+
@import '~reset-css/sass/reset';
3+
4+
// 1. Usually a larger line height is beneficial
5+
// for blocks of text, but we want to have a
6+
// rather small line height for our basic UI
7+
// elements so we can apply uniform spacings
8+
// using margins and paddings. We'll add an
9+
// extra CSS class with a larger line height
10+
// to apply to blocks of text.
11+
// 2. A kind of “dirty” white is more pleasing
12+
// to the eyes.
13+
// 3. A kind of “almost black but not quite black”
14+
// is also more pleasing to the eyes.
15+
body {
16+
line-height: 1.25; // 1
17+
background-color: #f9f9f9; // 2
18+
color: #222; // 3
19+
font-family: sans-serif;
20+
}
21+
22+
// 1. Larger font sizes need less line height.
23+
h1,
24+
h2,
25+
h3,
26+
h4,
27+
h5 {
28+
line-height: 1.2; // 1
29+
font-weight: 700;
30+
}
31+
32+
h1 {
33+
font-size: 2.027em;
34+
}
35+
36+
h2 {
37+
font-size: 1.802em;
38+
}
39+
40+
h3 {
41+
font-size: 1.602em;
42+
}
43+
44+
h4 {
45+
font-size: 1.424em;
46+
}
47+
48+
h5 {
49+
font-size: 1.266em;
50+
}
51+
52+
h6 {
53+
font-size: 1.125em;
54+
}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import '~@avalanche/setting-spacings';

src/main.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue';
2+
3+
import App from './App.vue';
4+
5+
Vue.config.productionTip = false;
6+
7+
new Vue({
8+
render: h => h(App),
9+
}).$mount(`#app`);

vue.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const nodeSassMagicImporter = require(`node-sass-magic-importer`);
2+
3+
module.exports = {
4+
css: {
5+
loaderOptions: {
6+
sass: {
7+
importer: nodeSassMagicImporter(),
8+
},
9+
},
10+
},
11+
lintOnSave: false,
12+
};

0 commit comments

Comments
 (0)