Merge pull request #298 from MichaelMure/webui/gql-fragment-matcher

Use the IntrospectionFragmentMatcher & update dependencies
This commit is contained in:
Michael Muré 2020-01-21 21:05:58 +01:00 committed by GitHub
commit 00b1bd0434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5475 additions and 2516 deletions

View File

@ -1,3 +1,4 @@
{ {
"extends": ["react-app", "plugin:prettier/recommended"] "extends": ["react-app", "plugin:prettier/recommended"],
"ignorePatterns": ["src/fragmentTypes.js"]
} }

8
webui/codegen.yaml Normal file
View File

@ -0,0 +1,8 @@
schema: '../graphql/schema/*.graphql'
overwrite: true
generates:
./src/fragmentTypes.js:
plugins:
- fragment-matcher
config:
module: es2015

7931
webui/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,30 +6,33 @@
"@material-ui/core": "^4.3.3", "@material-ui/core": "^4.3.3",
"@material-ui/icons": "^4.2.1", "@material-ui/icons": "^4.2.1",
"@material-ui/styles": "^4.3.3", "@material-ui/styles": "^4.3.3",
"apollo-boost": "^0.3.1", "apollo-boost": "^0.4.7",
"graphql": "^14.3.0", "graphql": "^14.3.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"react": "^16.8.6", "react": "^16.8.6",
"react-apollo": "^2.5.6", "react-apollo": "^3.1.3",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-router": "^5.0.0", "react-router": "^5.0.0",
"react-router-dom": "^5.0.0", "react-router-dom": "^5.0.0",
"react-scripts": "^3.1.1", "react-scripts": "^3.1.1",
"remark-html": "^9.0.0", "remark-html": "^10.0.0",
"remark-parse": "^6.0.3", "remark-parse": "^7.0.2",
"remark-react": "^5.0.1", "remark-react": "^6.0.0",
"unified": "^7.1.0" "unified": "^8.4.2"
}, },
"devDependencies": { "devDependencies": {
"eslint-config-prettier": "^4.3.0", "@graphql-codegen/cli": "^1.11.2",
"eslint-plugin-prettier": "^3.1.0", "@graphql-codegen/fragment-matcher": "^1.11.2",
"prettier": "^1.17.1" "eslint-config-prettier": "^6.9.0",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "npm run generate && react-scripts start",
"build": "react-scripts build", "build": "npm run generate && react-scripts build",
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"generate": "graphql-codegen",
"lint": "eslint src/" "lint": "eslint src/"
}, },
"proxy": "http://localhost:3001", "proxy": "http://localhost:3001",

1
webui/src/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
fragmentTypes.js

View File

@ -1,17 +1,27 @@
import ThemeProvider from '@material-ui/styles/ThemeProvider'; import ThemeProvider from '@material-ui/styles/ThemeProvider';
import { createMuiTheme } from '@material-ui/core/styles'; import { createMuiTheme } from '@material-ui/core/styles';
import ApolloClient from 'apollo-boost'; import ApolloClient from 'apollo-boost';
import {
IntrospectionFragmentMatcher,
InMemoryCache,
} from 'apollo-cache-inmemory';
import React from 'react'; import React from 'react';
import { ApolloProvider } from 'react-apollo'; import { ApolloProvider } from 'react-apollo';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import introspectionQueryResultData from './fragmentTypes';
import App from './App'; import App from './App';
const theme = createMuiTheme(); const theme = createMuiTheme();
const client = new ApolloClient({ const client = new ApolloClient({
uri: '/graphql', uri: '/graphql',
cache: new InMemoryCache({
fragmentMatcher: new IntrospectionFragmentMatcher({
introspectionQueryResultData,
}),
}),
}); });
ReactDOM.render( ReactDOM.render(

View File

@ -2,7 +2,6 @@ import { makeStyles } from '@material-ui/styles';
import TableCell from '@material-ui/core/TableCell/TableCell'; import TableCell from '@material-ui/core/TableCell/TableCell';
import TableRow from '@material-ui/core/TableRow/TableRow'; import TableRow from '@material-ui/core/TableRow/TableRow';
import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import Tooltip from '@material-ui/core/Tooltip/Tooltip';
import Typography from '@material-ui/core/Typography';
import ErrorOutline from '@material-ui/icons/ErrorOutline'; import ErrorOutline from '@material-ui/icons/ErrorOutline';
import gql from 'graphql-tag'; import gql from 'graphql-tag';
import React from 'react'; import React from 'react';