Create a GraphQL HTTP server with any HTTP web framework that supports connect styled middleware, including Connect itself, Express and Restify. This module includes a TypeScript declaration file to enable auto complete in compatible editors and type information for TypeScript projects. Use .get or .post (or both) rather than .use to configure your route handler. If you want to show GraphiQL in the browser, set graphiql, true on your .get handler. An optional function for adding additional metadata to the GraphQL response as a key-value object is provided. The result will be added to the "extensions" field in the resulting JSON. This is often a useful place to add development time metadata such as the runtime of a query or the amount of resources consumed. This may be an async function. The function is given one object as an argument: { document, variables, operationName, result, context }.

Features

  • In addition to an object defining each option, options can also be provided as a function
  • Once installed at a path, express-graphql will accept requests with specific parameters
  • GraphQL will first look for each parameter in the query string of a URL
  • Combine with other express middleware
  • The GraphQL response allows for adding additional information in a response to a GraphQL query
  • GraphQL's validation phase checks the query to ensure that it can be successfully executed against the schema

Project Samples

Project Activity

See All Activity >

License

MIT License
You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of GraphQL HTTP Server Middleware!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript HTTP Servers, TypeScript Web Development Frameworks

Registered

2021-09-10