mirror of
https://github.com/seigler/graphql-playground
synced 2025-07-26 00:56:09 +00:00
Client initial commit
This commit is contained in:
parent
f8e7e2d9e3
commit
7bc3484b71
11 changed files with 7802 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
node_modules/
|
||||
.vscode/
|
||||
.env
|
||||
client/dist/
|
||||
client/.cache/
|
||||
|
|
10
README.md
10
README.md
|
@ -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
5
client/.babelrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"plugins": [
|
||||
["@babel/plugin-transform-react-jsx"]
|
||||
]
|
||||
}
|
7715
client/package-lock.json
generated
Normal file
7715
client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
6
client/postcss.config.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
plugins: [
|
||||
require('tailwindcss'),
|
||||
require('autoprefixer')
|
||||
]
|
||||
};
|
3
client/src/app.js
Normal file
3
client/src/app.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
import React from 'react';
|
||||
|
||||
export default () => <div>Hi</div>;
|
3
client/src/index.css
Normal file
3
client/src/index.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
14
client/src/index.html
Normal file
14
client/src/index.html
Normal 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
19
client/src/index.js
Normal 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);
|
7
client/tailwind.config.js
Normal file
7
client/tailwind.config.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
theme: {
|
||||
extend: {}
|
||||
},
|
||||
variants: {},
|
||||
plugins: []
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue