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

@graphql-tools/merge

Package Overview
Dependencies
Maintainers
3
Versions
1145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/merge

A set of utils for faster development of GraphQL tools

  • 9.0.4-rc-20240429230957-cb141a8c7fe57efcb7c365829f56e3eba14b7d51
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.7M
decreased by-3.73%
Maintainers
3
Weekly downloads
 
Created

What is @graphql-tools/merge?

The @graphql-tools/merge package is designed to provide a set of utilities for merging GraphQL schemas and type definitions. It is part of the larger GraphQL Tools library, which offers a variety of tools for working with GraphQL schemas, including stitching, mocking, and more. The merge package specifically focuses on combining multiple GraphQL type definitions and schemas into a single schema, which is particularly useful in modularized codebases where schema definitions may be spread across multiple files or modules.

What are @graphql-tools/merge's main functionalities?

Merging GraphQL Type Definitions

This feature allows for the merging of GraphQL type definitions from multiple sources. It's useful for modularizing your GraphQL schema definitions.

const { mergeTypeDefs } = require('@graphql-tools/merge');
const typeDefs1 = `type Query { foo: String }`;
const typeDefs2 = `type Query { bar: Int }`;
const mergedTypeDefs = mergeTypeDefs([typeDefs1, typeDefs2]);

Merging GraphQL Schemas

This feature enables the merging of multiple GraphQL schemas into a single schema. It is particularly useful for combining schemas from different parts of an application or different services.

const { makeExecutableSchema } = require('@graphql-tools/schema');
const { mergeSchemas } = require('@graphql-tools/merge');
const schema1 = makeExecutableSchema({ typeDefs: `type Query { foo: String }` });
const schema2 = makeExecutableSchema({ typeDefs: `type Query { bar: Int }` });
const mergedSchema = mergeSchemas({ schemas: [schema1, schema2] });

Other packages similar to @graphql-tools/merge

FAQs

Package last updated on 29 Apr 2024

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