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

@graphql-inspector/core

Package Overview
Dependencies
Maintainers
3
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-inspector/core

Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.

  • 5.1.1-alpha-20240507131549-7fe0a3c4930a3be0b479cd16e3c96cc36c52f7e8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
261K
decreased by-10.87%
Maintainers
3
Weekly downloads
 
Created

What is @graphql-inspector/core?

@graphql-inspector/core is a powerful tool for GraphQL schema management. It helps developers detect changes, validate schemas, and compare different versions of GraphQL schemas. This package is particularly useful for maintaining the integrity of GraphQL APIs over time.

What are @graphql-inspector/core's main functionalities?

Schema Comparison

This feature allows you to compare two GraphQL schemas and detect changes between them. The code sample demonstrates how to use the `diff` function to find differences between an old schema and a new schema.

const { diff } = require('@graphql-inspector/core');
const oldSchema = `type Query { hello: String }`;
const newSchema = `type Query { hello: String, goodbye: String }`;
const changes = diff(oldSchema, newSchema);
console.log(changes);

Schema Validation

This feature helps you validate a GraphQL schema to ensure it adheres to the GraphQL specification. The code sample shows how to use the `validate` function to check a schema for errors.

const { validate } = require('@graphql-inspector/core');
const schema = `type Query { hello: String }`;
const errors = validate(schema);
console.log(errors);

Schema Coverage

This feature allows you to check how well your GraphQL queries cover your schema. The code sample demonstrates how to use the `coverage` function to analyze the coverage of a schema based on provided documents.

const { coverage } = require('@graphql-inspector/core');
const schema = `type Query { hello: String }`;
const documents = [{ content: `{ hello }` }];
const result = coverage(schema, documents);
console.log(result);

Other packages similar to @graphql-inspector/core

Keywords

FAQs

Package last updated on 07 May 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