@treelight/graphql
v0.6.0
Published
Treelight language module for graphql.
Downloads
931
Maintainers
Readme
@treelight/graphql
GraphQL language definition for Treelight.
Install
npm install @treelight/core @treelight/graphql @treelight/theme-github-darkUsage
import { Highlighter } from '@treelight/core';
import graphql from '@treelight/graphql';
import githubDark from '@treelight/theme-github-dark';
const highlighter = await Highlighter.create({
languages: [graphql],
themes: [githubDark],
theme: 'github-dark',
});
const html = highlighter.highlight("query Viewer {\n viewer {\n login\n }\n}", 'graphql');This package includes the Tree-sitter grammar WASM and highlight queries for GraphQL.
See the Treelight README for full usage.
