Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
learn: add vue graphql tutorials (#2091)
- Loading branch information
1 parent
4253817
commit a63009c
Showing
110 changed files
with
29,819 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
46 changes: 46 additions & 0 deletions
46
community/learn/graphql-tutorials/manifests/vue-apollo.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: vue-apollo | ||
name: vue-apollo | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: vue-apollo | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxUnavailable: 0 | ||
maxSurge: 100% | ||
template: | ||
metadata: | ||
labels: | ||
app: vue-apollo | ||
spec: | ||
containers: | ||
- image: hasura/base-git-image:0.7 | ||
imagePullPolicy: IfNotPresent | ||
name: vue-apollo | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: vue-apollo | ||
name: vue-apollo | ||
namespace: default | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: vue-apollo | ||
type: ClusterIP |
67 changes: 67 additions & 0 deletions
67
community/learn/graphql-tutorials/tutorials/react-apollo/tutorial-site/src/html.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
|
||
export default class HTML extends React.Component { | ||
render() { | ||
return ( | ||
<html {...this.props.htmlAttributes}> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta httpEquiv="x-ua-compatible" content="ie=edge" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no" | ||
/> | ||
<meta name="title" content="A GraphQL course for React developers | Hasura" /> | ||
<meta name="description" content="A concise and powerful tutorial that covers fundamental concepts of both GraphQL and using GraphQL in React" /> | ||
<meta property="og:title" content="A GraphQL course for React developers | Hasura" /> | ||
<meta property="og:description" content="A concise and powerful tutorial that covers fundamental concepts of both GraphQL and using GraphQL in React" /> | ||
<meta property="og:image" content="https://storage.googleapis.com/graphql-engine-cdn.hasura.io/learn-hasura/assets/twitter-card-react.png" /> | ||
<meta property="twitter:card" content="summary_large_image" /> | ||
<meta property="twitter:title" content="A GraphQL course for React developers | Hasura" /> | ||
<meta property="twitter:description" content="A concise and powerful tutorial that covers fundamental concepts of both GraphQL and using GraphQL in React" /> | ||
<meta property="twitter:image" content="https://storage.googleapis.com/graphql-engine-cdn.hasura.io/learn-hasura/assets/twitter-card-react.png" /> | ||
<link rel="stylesheet" | ||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" | ||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossOrigin="anonymous" /> | ||
<script | ||
src="https://code.jquery.com/jquery-3.3.1.min.js" | ||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" | ||
crossOrigin="anonymous"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossOrigin="anonymous"></script> | ||
{this.props.headComponents} | ||
</head> | ||
<body {...this.props.bodyAttributes}> | ||
{this.props.preBodyComponents} | ||
<div | ||
key={`body`} | ||
id="___gatsby" | ||
dangerouslySetInnerHTML={{ __html: this.props.body }} | ||
/> | ||
{this.props.postBodyComponents} | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
$(document).on('click','.navbar-collapse.in',function(e) { | ||
if( $(e.target).is('a') ) { | ||
$(this).collapse('hide'); | ||
} | ||
}); | ||
` | ||
}} | ||
/> | ||
</body> | ||
|
||
</html> | ||
) | ||
} | ||
} | ||
|
||
HTML.propTypes = { | ||
htmlAttributes: PropTypes.object, | ||
headComponents: PropTypes.array, | ||
bodyAttributes: PropTypes.object, | ||
preBodyComponents: PropTypes.array, | ||
body: PropTypes.string, | ||
postBodyComponents: PropTypes.array, | ||
} |
1 change: 1 addition & 0 deletions
1
community/learn/graphql-tutorials/tutorials/vue-apollo/app-boilerplate/.dockerignore
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
21 changes: 21 additions & 0 deletions
21
community/learn/graphql-tutorials/tutorials/vue-apollo/app-boilerplate/.gitignore
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw* |
20 changes: 20 additions & 0 deletions
20
community/learn/graphql-tutorials/tutorials/vue-apollo/app-boilerplate/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM node:carbon | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
||
# Install app dependencies | ||
RUN npm -g install serve | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
# Bundle app source | ||
COPY . /app | ||
#Build react/vue/angular bundle static files | ||
RUN npm run build | ||
|
||
EXPOSE 8080 | ||
# serve dist folder on port 8080 | ||
CMD ["serve", "-s", "dist", "-p", "8080"] |
18 changes: 18 additions & 0 deletions
18
community/learn/graphql-tutorials/tutorials/vue-apollo/app-boilerplate/README.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Tutorial | ||
-------- | ||
|
||
- [Vue](https://learn.hasura.io/graphql/vue/introduction) | ||
- [Hasura GraphQL Endpoint](https://learn.hasura.io/graphql) | ||
|
||
Tech stack | ||
---------- | ||
|
||
- Frontend | ||
- Vue 2.6+ | ||
- Vue Apollo | ||
|
||
Run the Vue app | ||
--------------- | ||
|
||
Run `npm run serve` to start the todo app. | ||
|
4 changes: 4 additions & 0 deletions
4
community/learn/graphql-tutorials/tutorials/vue-apollo/app-boilerplate/auth_config.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"domain": "graphql-tutorials.auth0.com", | ||
"clientId": "P38qnFo1lFAQJrzkun--wEzqljVNGcWW" | ||
} |
3 changes: 3 additions & 0 deletions
3
community/learn/graphql-tutorials/tutorials/vue-apollo/app-boilerplate/babel.config.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ["@vue/app"] | ||
}; |
Oops, something went wrong.