Socket
Socket
Sign inDemoInstall

apollo-server-types

Package Overview
Dependencies
55
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-server-types

Apollo Server shared types


Version published
Maintainers
1
Weekly downloads
1,151,301
decreased by-20%
Install size
4.76 MB

Weekly downloads

Package description

What is apollo-server-types?

The `apollo-server-types` package provides TypeScript definitions and utility types for building GraphQL servers with Apollo Server. It includes types for server lifecycle events, request and response handling, and plugin development. This package is primarily used by developers to ensure type safety and to leverage IntelliSense in IDEs for better development experience when working with Apollo Server.

What are apollo-server-types's main functionalities?

GraphQLRequestContext

Defines the context for a GraphQL request. Useful for passing request-specific information through the resolver chain, such as the current user.

{"context": (integrationContext) => { return { user: integrationContext.req.user }; }}

Plugin

Allows the creation of plugins to modify or extend the behavior of Apollo Server at different stages of the server lifecycle.

{"serverWillStart(service) { console.log(`GraphQL Server is starting!`); }}

ValueOrPromise

A utility type that represents a value that could either be returned directly or resolved from a Promise. Useful for functions that might need to perform asynchronous operations.

{"function possiblyAsyncFunction(): ValueOrPromise<string> { return new Promise(resolve => resolve('Hello World')); }}

Other packages similar to apollo-server-types

Readme

Source

apollo-server-types

These are types which are shared across Apollo Server packages, but kept here to avoid circular dependencies.

FAQs

Last updated on 02 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc