npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@theguild/graphql-language-service-cli

v3.3.0

Published

An interface for building GraphQL language services for IDEs

Downloads

34

Readme

graphql-language-service-cli

Note: As of 3.0.0, this package has been renamed from graphql-language-service to graphql-language-service-cli. please now use the graphql-lsp bin, instead of the graphql binary.

NPM npm downloads Snyk Vulnerabilities for npm package License

We welcome your feedback and suggestions.

GraphQL Language Service provides an interface for building GraphQL language services for IDEs.

Almost 100% for Microsoft's Language Server Protocol is in place

Supported features include:

  • Diagnostics (GraphQL syntax linting/validations) (spec-compliant)
  • Autocomplete suggestions (spec-compliant)
  • Hyperlink to fragment definitions and named types (type, input, enum) definitions (spec-compliant)
  • Outline view support for queries and SDL
  • Symbols support across the workspace

see more information at graphql-language-service-server

Installation and Usage

Dependencies

An LSP-compatible client with a file watcher that sends watch notifications to the server.

DROPPED: GraphQL Language Service no longer depends on Watchman

Only node 9 or greater, and npm or yarn are required dependencies.

Installation

with yarn:

yarn global add graphql-language-service-cli

with npm:

npm i -g graphql-language-service-cli

either will install the graphql-lsp bin globally

GraphQL configuration file (.graphqlrc.yml)

Check out graphql-config

The custom graphql language configurations are:

  • customDirectives - ['@myExampleDirective']
  • customValidationRules - returns rules array with parameter ValidationContext from graphql/validation

Using the command-line interface

graphql-lsp server --schema=localhost:3000

The node executable contains several commands: server and the command-line language service methods (validate, autocomplete, outline).


GraphQL Language Service Command-Line Interface.

Usage: graphql-lsp <command> <file>

[-h | --help][-c | --configdir] {configDir}
[-t | --text] {textBuffer}
[-f | --file] {filePath}
[-s | --schema] {schemaPath}

Options:

-h, --help Show help [boolean]

-t, --text Text buffer to perform GraphQL diagnostics on.
Will defer to --file option if omitted.
Overrides the --file option, if any.
[string]

-f, --file File path to perform GraphQL diagnostics on.
Will be ignored if --text option is supplied.
[string]

--row A row number from the cursor location for GraphQL
autocomplete suggestions.
If omitted, the last row number will be used.
[number]

--column A column number from the cursor location for GraphQL
autocomplete suggestions.
If omitted, the last column number will be used.
[number]

-c, --configDir Path to the .graphqlrc.yml configuration file.
Walks up the directory tree from the provided config
directory, or the current working directory, until a
.graphqlrc is found or the root directory is found.
[string]

-s, --schemaPath a path to schema DSL file
[string]

At least one command is required.
Commands: "server, validate, autocomplete, outline"