Human Connection
docs-add_missing_env_instruction
docs-add_missing_env_instruction
  • Introduction
  • Edit this Documentation
  • Installation
  • Backend
    • graphql-with-apollo
      • GraphQL with Apollo
        • Mocking
        • Seeding
    • Import
    • Middleware
  • Webapp
    • COMPONENTS
    • PLUGINS
    • STORE
    • PAGES
    • ASSETS
    • LAYOUTS
    • Styleguide
    • STATIC
    • MIDDLEWARE
  • Testing Guide
    • End-to-end tests
    • Frontend tests
    • Backend tests
  • Contributing
  • Deployment
  • Feature Specification
  • Code of conduct
  • License
Powered by GitBook
On this page

Was this helpful?

  1. Backend

Middleware

PreviousImportNextWebapp

Last updated 6 years ago

Was this helpful?

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.

A common problem in GraphQL servers is that resolvers often get cluttered with business logic, making the entire resolver system harder to understand and maintain.

GraphQL Middleware uses the (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.

middleware pattern