From 6714cebad842efdb570d035968789f73d161adfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 15 Apr 2019 00:57:35 +0200 Subject: [PATCH] Merge more backend docs --- SUMMARY.md | 8 ++------ .../README.md} | 4 +++- backend/graphql-with-apollo/README.md | 2 -- .../graphql-with-apollo/README.md | 6 ------ .../graphql-with-apollo/mocking.md | 8 -------- .../graphql-with-apollo/seeding.md | 20 ------------------- backend/{middleware.md => graphql.md} | 10 ++++++++-- 7 files changed, 13 insertions(+), 45 deletions(-) rename backend/{data-import.md => db-migration-worker/README.md} (92%) delete mode 100644 backend/graphql-with-apollo/README.md delete mode 100644 backend/graphql-with-apollo/graphql-with-apollo/README.md delete mode 100644 backend/graphql-with-apollo/graphql-with-apollo/mocking.md delete mode 100644 backend/graphql-with-apollo/graphql-with-apollo/seeding.md rename backend/{middleware.md => graphql.md} (70%) diff --git a/SUMMARY.md b/SUMMARY.md index cf9c463cf..c993fe120 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -4,12 +4,8 @@ * [Edit this Documentation](edit-this-documentation.md) * [Installation](installation.md) * [Backend](backend/README.md) - * [graphql-with-apollo](backend/graphql-with-apollo/README.md) - * [GraphQL with Apollo](backend/graphql-with-apollo/graphql-with-apollo/README.md) - * [Mocking](backend/graphql-with-apollo/graphql-with-apollo/mocking.md) - * [Seeding](backend/graphql-with-apollo/graphql-with-apollo/seeding.md) - * [Import](backend/data-import.md) - * [Middleware](backend/middleware.md) + * [GraphQL](backend/graphql.md) + * [Legacy Migration](backend/db-migration-worker/README.md) * [Webapp](webapp/README.md) * [COMPONENTS](webapp/components.md) * [PLUGINS](webapp/plugins.md) diff --git a/backend/data-import.md b/backend/db-migration-worker/README.md similarity index 92% rename from backend/data-import.md rename to backend/db-migration-worker/README.md index 0f55b9e2d..3d0f86edd 100644 --- a/backend/data-import.md +++ b/backend/db-migration-worker/README.md @@ -1,7 +1,9 @@ -# Import +# Legacy Migration This guide helps you to import data from our legacy servers, which are using FeathersJS and MongoDB. +**You can skip this if you don't plan to migrate any legacy applications!** + ## Prerequisites You need [docker](https://www.docker.com/) installed on your machine. Furthermore you need SSH access to the server and you need to know the following login credentials and server settings: diff --git a/backend/graphql-with-apollo/README.md b/backend/graphql-with-apollo/README.md deleted file mode 100644 index 0d5e196cb..000000000 --- a/backend/graphql-with-apollo/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# graphql-with-apollo - diff --git a/backend/graphql-with-apollo/graphql-with-apollo/README.md b/backend/graphql-with-apollo/graphql-with-apollo/README.md deleted file mode 100644 index 7fe29fd72..000000000 --- a/backend/graphql-with-apollo/graphql-with-apollo/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# GraphQL with Apollo - -GraphQL is a data query language which provides an alternative to REST and ad-hoc web service architectures. It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server. - -![GraphQL Playground](../../../.gitbook/assets/graphql-playground%20%281%29.png) - diff --git a/backend/graphql-with-apollo/graphql-with-apollo/mocking.md b/backend/graphql-with-apollo/graphql-with-apollo/mocking.md deleted file mode 100644 index 49c6fd1a7..000000000 --- a/backend/graphql-with-apollo/graphql-with-apollo/mocking.md +++ /dev/null @@ -1,8 +0,0 @@ -# Mocking - -## Mocking API Results - -Alternatively you can just mock all responses from the api which let you build a frontend application without running a neo4j instance. - -Just set `MOCK=true` inside `.env` or pass it on application start. - diff --git a/backend/graphql-with-apollo/graphql-with-apollo/seeding.md b/backend/graphql-with-apollo/graphql-with-apollo/seeding.md deleted file mode 100644 index 010607477..000000000 --- a/backend/graphql-with-apollo/graphql-with-apollo/seeding.md +++ /dev/null @@ -1,20 +0,0 @@ -# Seeding - -## Seeding The Database - -Optionally you can seed the GraphQL service by executing mutations that will write sample data to the database: - -{% tabs %} -{% tab title="Yarn" %} -```bash -yarn db:seed -``` -{% endtab %} - -{% tab title="NPM" %} -```bash -npm run db:seed -``` -{% endtab %} -{% endtabs %} - diff --git a/backend/middleware.md b/backend/graphql.md similarity index 70% rename from backend/middleware.md rename to backend/graphql.md index 6a0bf2f57..12cc59e57 100644 --- a/backend/middleware.md +++ b/backend/graphql.md @@ -1,8 +1,13 @@ -# Middleware +# GraphQL with Apollo + +GraphQL is a data query language which provides an alternative to REST and ad-hoc web service architectures. It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server. + +![GraphQL Playground](../../../.gitbook/assets/graphql-playground%20%281%29.png) + +## Middleware keeps resolvers clean ![](../.gitbook/assets/grafik-4.png) -## Middleware keeps resolvers clean A well-organized codebase is key for the ability to maintain and easily introduce changes into an app. Figuring out the right structure for your code remains a continuous challenge - especially as an application grows and more developers are joining a project. @@ -10,3 +15,4 @@ A common problem in GraphQL servers is that resolvers often get cluttered with b GraphQL Middleware uses the [_middleware pattern_](https://dzone.com/articles/understanding-middleware-pattern-in-expressjs) \(well-known from Express.js\) to pull out repetitive code from resolvers and execute it before or after one of your resolvers is invoked. This improves code modularity and keeps your resolvers clean and simple. +