Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@labdigital/apollo-gateway-directives

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@labdigital/apollo-gateway-directives

This plugin allows you to handle GraphQL directives within Apollo Gateway.

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Apollo Gateway Directives Plugin

This plugin allows you to handle GraphQL directives within Apollo Gateway.

Installation

pnpm add @labdigital/apollo-gateway-directives

Usage

import { GatewayDirectivesPlugin } from '@labdigital/apollo-gateway-directives';
import type { BaseContext } from "@apollo/server";

type ContextValue extends BaseContext {
  foobar: string;
}

const directivesPlugin = new GatewayDirectivesPlugin<ContextValue>({
  // Define the directive handlers here
  myDirective: async (
    args: Record<string, unknown>,
    context: ContextValue,
  ) => {
    // Do something with the directive
  }
});

const gateway = new ApolloGateway({
  // ...
});

gateway.onSchemaLoadOrUpdate((schema) => {
  directivesPlugin.parseSchema(schema.apiSchema);
});

const server = new ApolloServer({
  gateway,
  plugins: [
    directivesPlugin,
  ]
});

await server.start();

FAQs

Package last updated on 09 Jan 2025

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc