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

apollo-language-server

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-language-server

A language server for Apollo GraphQL projects

  • 1.14.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
285K
decreased by-1.35%
Maintainers
1
Weekly downloads
 
Created

What is apollo-language-server?

The apollo-language-server npm package provides tools and utilities for working with GraphQL schemas and operations in an Apollo-based environment. It offers features such as schema validation, query validation, and more, making it easier to develop and maintain GraphQL APIs.

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

Schema Validation

This feature allows you to validate a GraphQL schema to ensure it adheres to the GraphQL specification. The code sample demonstrates how to validate a simple schema and log any validation errors.

const { validateSchema } = require('apollo-language-server');
const schema = `type Query { hello: String }`;
const errors = validateSchema(schema);
if (errors.length > 0) {
  console.error('Schema validation errors:', errors);
} else {
  console.log('Schema is valid');
}

Query Validation

This feature allows you to validate a GraphQL query against a given schema. The code sample shows how to validate a query and log any validation errors.

const { validateQuery } = require('apollo-language-server');
const schema = `type Query { hello: String }`;
const query = `{ hello }`;
const errors = validateQuery(schema, query);
if (errors.length > 0) {
  console.error('Query validation errors:', errors);
} else {
  console.log('Query is valid');
}

Schema Parsing

This feature allows you to parse a GraphQL schema into an abstract syntax tree (AST). The code sample demonstrates how to parse a schema and log the resulting AST.

const { parseSchema } = require('apollo-language-server');
const schema = `type Query { hello: String }`;
const parsedSchema = parseSchema(schema);
console.log('Parsed schema:', parsedSchema);

Other packages similar to apollo-language-server

FAQs

Package last updated on 13 Aug 2019

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