Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@graphql-tools/utils
Advanced tools
The @graphql-tools/utils package provides a variety of utility functions to manipulate and work with GraphQL schemas. It is part of the larger GraphQL Tools ecosystem, which is designed to provide a more efficient and flexible way to work with GraphQL, especially in regards to schema handling and transformation.
Schema Merging
This feature allows you to merge multiple GraphQL schemas into one. This is particularly useful in a microservices architecture where different parts of your application might have their own schemas.
const { mergeSchemas } = require('@graphql-tools/utils');
const schema1 = /* GraphQLSchema object */;
const schema2 = /* GraphQLSchema object */;
const mergedSchema = mergeSchemas({ schemas: [schema1, schema2] });
Type Filtering
This utility helps in filtering out specific types from a GraphQL schema based on custom logic. It's useful for creating permission-based schema views.
const { filterSchema, removeTypes } = require('@graphql-tools/utils');
const schema = /* GraphQLSchema object */;
const filteredSchema = filterSchema({
schema,
typeFilter: (typeName, type) => typeName.startsWith('User')
});
Schema Printing
This function extends the basic functionality of GraphQL's printSchema to include custom directives in the output, which is essential for schemas that use them extensively.
const { printSchemaWithDirectives } = require('@graphql-tools/utils');
const schema = /* GraphQLSchema object */;
const schemaSDL = printSchemaWithDirectives(schema);
This package is a more comprehensive set of tools that includes utilities for mocking, stitching, and merging schemas. It's broader than @graphql-tools/utils, which focuses more narrowly on utility functions.
This toolkit allows you to construct GraphQL schema with an object-oriented approach. It provides utilities similar to @graphql-tools/utils but adds a layer of abstraction to build schemas using classes and methods, which some may find more intuitive.
FAQs
Common package containing utils and types for GraphQL tools
The npm package @graphql-tools/utils receives a total of 10,078,970 weekly downloads. As such, @graphql-tools/utils popularity was classified as popular.
We found that @graphql-tools/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.