Client initial commit

This commit is contained in:
Joshua Seigler 2020-01-30 22:46:01 -05:00
parent f8e7e2d9e3
commit 7bc3484b71
11 changed files with 7802 additions and 2 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
node_modules/
.vscode/
.env
client/dist/
client/.cache/

View file

@ -1,8 +1,18 @@
Repository for following https://www.youtube.com/watch?v=ed8SzALpx1Q
I stuck with the video for the server, but did my own thing for the client.
## Usage
### Server
```
cd server
npm install
npm start
```
### Client
```
cd client
npm install
npm start
```

5
client/.babelrc Normal file
View file

@ -0,0 +1,5 @@
{
"plugins": [
["@babel/plugin-transform-react-jsx"]
]
}

7715
client/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -4,12 +4,28 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "parcel src/index.html"
},
"repository": {
"type": "git",
"url": "git+https://github.com/seigler/graphql-playground.git"
},
"author": "Joshua Seigler",
"license": "MIT"
"license": "MIT",
"dependencies": {
"graphql": "^14.6.0",
"urql": "^1.8.2"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-transform-react-jsx": "^7.8.3",
"autoprefixer": "^9.7.4",
"parcel-bundler": "^1.12.4",
"postcss": "^7.0.26",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"rimraf": "^3.0.1",
"tailwindcss": "^1.1.4"
}
}

6
client/postcss.config.js Normal file
View file

@ -0,0 +1,6 @@
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer')
]
};

3
client/src/app.js Normal file
View file

@ -0,0 +1,3 @@
import React from 'react';
export default () => <div>Hi</div>;

3
client/src/index.css Normal file
View file

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

14
client/src/index.html Normal file
View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>GraphQL Client Demo</title>
<script defer src="index.js"></script>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div id="root"></div>
</body>
</html>

19
client/src/index.js Normal file
View file

@ -0,0 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createClient, defaultExchanges, Provider } from 'urql';
import App from './app';
const client = createClient({
url: 'http://localhost:4000/graphql',
exchanges: defaultExchanges
});
const app = (
<Provider value={client}>
<App />
</Provider>
);
const rootElement = document.getElementById('root');
ReactDOM.render(app, rootElement);

View file

@ -0,0 +1,7 @@
module.exports = {
theme: {
extend: {}
},
variants: {},
plugins: []
};