From 64e6b861b6ed792cb1aacc1a60ef41fd8278ec1d Mon Sep 17 00:00:00 2001 From: Christoph Lienhard Date: Sat, 22 Aug 2020 16:40:12 +0200 Subject: [PATCH] Last not Least: Get party details page from backend Also * reorder graphQl queries: Always a query constant + update function * use id instead of token (initials) to identify person in url * Remove any party logo related sections since currently not needed * Move "options" from data closer to actual code since it doesn't really belong to data (data may be deleted in the future, anyway) * add nodeId in gql queries wherever possible to avoid problems with the apollo cache * add note about graphql schema import to README.md --- .gitignore | 2 +- README.md | 11 +- src/app/euromat/components/emphasis.vue | 7 +- src/app/euromat/components/results.vue | 50 +- src/app/euromat/components/theses.vue | 31 +- src/app/euromat/graphqlQueries.js | 155 +- .../euromat/possiblePositions.js} | 5 +- src/app/party/components/index.vue | 116 +- src/data/index.js | 6 - src/data/parties.js | 3803 ----------------- src/data/theses.js | 45 - 11 files changed, 196 insertions(+), 4035 deletions(-) rename src/{data/options.js => app/euromat/possiblePositions.js} (76%) delete mode 100644 src/data/parties.js delete mode 100644 src/data/theses.js diff --git a/.gitignore b/.gitignore index 1c61776..c6edc6b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,4 @@ yarn-error.log* *.sw* # GraphQl plugin related -./postgraphile-schema.graphql +postgraphile-schema.graphql diff --git a/README.md b/README.md index eef7f37..c9cf10f 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,19 @@ This is a Vue.js progressive web application, developed with [`@vue/cli`](https: | `npm run serve` | Serve with hot reload at localhost:8080 | | `npm run build` | Build for production with minification | | `npm run test:unit` | Run all unit tests | -| `npm run lint` | Runs `standard` over all `.js` and `.vue` files | +| `npm run lint` | Runs `standard` over all `.js` and `.vue` files and fixes problems | | `npm run svg` | Creates all SVG files used in the application | | `npm run admin` | Creates `config.yml` for Netlify CMS admin UI | +### Working with GraphQl backend + +As a connector to the backend, `apollo-vue` is used. +Queries are written as `gql` strings. +To have schema hints etc, there is a `.graphqlconfig` file which should help dedicated IDE plugins +to infer the GraphQl schema directly from the (running) backend +(see main project for more information on how a "running backend" is achieved). +For example, the Intellij JS GraphQL plugin will automatically ask to download the schema definition. + ### Notes * To keep the diff to the original euromat source as small as possible certain variables follow a naming convention which may seem weird at first. diff --git a/src/app/euromat/components/emphasis.vue b/src/app/euromat/components/emphasis.vue index 32d8c10..f048811 100644 --- a/src/app/euromat/components/emphasis.vue +++ b/src/app/euromat/components/emphasis.vue @@ -38,7 +38,7 @@