All Projects → jparise → Vim Graphql

jparise / Vim Graphql

Licence: mit
A Vim plugin that provides GraphQL file detection, syntax highlighting, and indentation.

Projects that are alternatives of or similar to Vim Graphql

Graphql Live Query
Realtime GraphQL Live Queries with JavaScript
Stars: ✭ 112 (-68.63%)
Mutual labels:  graphql, graphql-schema
Graphql S2s
Add GraphQL Schema support for type inheritance, generic typing, metadata decoration. Transpile the enriched GraphQL string schema into the standard string schema understood by graphql.js and the Apollo server client.
Stars: ✭ 171 (-52.1%)
Mutual labels:  graphql, graphql-schema
Go Proto Gql
Protobuff plugins for generating graphql schema and golang to graphql bindings. Also supports a graphql gateway (Alpha)
Stars: ✭ 127 (-64.43%)
Mutual labels:  graphql, graphql-schema
Graphql Schema Language Cheat Sheet
GraphQL Shorthand Notation Cheat Sheet
Stars: ✭ 1,181 (+230.81%)
Mutual labels:  graphql, graphql-schema
Gramps Legacy
The core data source combination engine of GrAMPS.
Stars: ✭ 198 (-44.54%)
Mutual labels:  graphql, graphql-schema
Graphql Transform Schema
Transform, filter & alias resolvers of a GraphQL schema
Stars: ✭ 84 (-76.47%)
Mutual labels:  graphql, graphql-schema
Apollo Server
🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
Stars: ✭ 12,145 (+3301.96%)
Mutual labels:  graphql, graphql-schema
Sql To Graphql Schema Generator
⚛️ Generate GraphQL Scheme Online From SQL Query - https://sql-to-graphql.now.sh/
Stars: ✭ 32 (-91.04%)
Mutual labels:  graphql, graphql-schema
Nexus
Code-First, Type-Safe, GraphQL Schema Construction
Stars: ✭ 2,722 (+662.46%)
Mutual labels:  graphql, graphql-schema
Hotchocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
Stars: ✭ 3,009 (+742.86%)
Mutual labels:  graphql, graphql-schema
Snowflaqe
A dotnet CLI tool to work with GraphQL queries: static query verification, type checking and code generating type-safe clients for F# and Fable.
Stars: ✭ 69 (-80.67%)
Mutual labels:  graphql, graphql-schema
Graphql Weaver
A tool to combine, link and transform GraphQL schemas
Stars: ✭ 235 (-34.17%)
Mutual labels:  graphql, graphql-schema
Graphql Typescript
Define and build GraphQL Schemas using typed classes
Stars: ✭ 67 (-81.23%)
Mutual labels:  graphql, graphql-schema
Graphql Log
Add logging to your GraphQL resolvers so you know what's going on in your app.
Stars: ✭ 94 (-73.67%)
Mutual labels:  graphql, graphql-schema
Graphql Modules
⚠️ [DEPRECATED] GraphQL module library for Apollo.
Stars: ✭ 53 (-85.15%)
Mutual labels:  graphql, graphql-schema
Graphbrainz
A fully-featured GraphQL interface for the MusicBrainz API.
Stars: ✭ 130 (-63.59%)
Mutual labels:  graphql, graphql-schema
Graphql Config
One configuration for all your GraphQL tools (supported by most tools, editors & IDEs)
Stars: ✭ 883 (+147.34%)
Mutual labels:  graphql, graphql-schema
Fullstack Graphql
🌈 Simple Fullstack GraphQL Application. API built with Express + GraphQL + Sequelize (supports MySQL, Postgres, Sqlite and MSSQL). WebApp built with React + Redux to access the API. Written in ES6 using Babel + Webpack.
Stars: ✭ 955 (+167.51%)
Mutual labels:  graphql, graphql-schema
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-49.3%)
Mutual labels:  graphql, graphql-schema
36 Graphql Concepts
📜 36 concepts every GraphQL developer should know.
Stars: ✭ 209 (-41.46%)
Mutual labels:  graphql, graphql-schema

GraphQL for Vim

This Vim plugin provides GraphQL file detection, syntax highlighting, and indentation. It currently targets the June 2018 edition of the GraphQL specification.

Installation

This plugin requires Vim version 8 or later. Equivalent Neovim versions are also supported.

Using vim-plug

  1. Add Plug 'jparise/vim-graphql' to ~/.vimrc
  2. vim +PluginInstall +qall

Using Vim Packages

mkdir -p ~/.vim/pack/jparise/start
cd ~/.vim/pack/jparise/start
git clone https://github.com/jparise/vim-graphql.git graphql
vim -u NONE -c "helptags graphql/doc" -c q

Syntax Highlighting

Complete syntax highlighting is enable for the graphql filetype. This filetype is automatically selected for filenames ending in .graphql, .graphqls, and .gql.

If you would like to enable automatic syntax support for more file extensions (e.g., *.prisma), create a file named ~/.vim/after/ftdetect/graphql.vim containing autocommand lines like:

au BufNewFile,BufRead *.prisma setfiletype graphql

JavaScript and TypeScript Support

GraphQL syntax support inside of ES2015 template literals is provided. It works "out of the box" with Vim 8.2+'s JavaScript and TypeScript language support. The extended JavaScript syntax provided by the vim-javascript plugin is also supported.

For older versions of Vim, TypeScript support can be enabled by installing the yats plugin.

const query = gql`
  {
    user(id: ${uid}) {
      firstName
      lastName
    }
  }
`;

The list of recognized tag names is defined by the g:graphql_javascript_tags variable, which defaults to ["gql", "graphql", "Relay.QL"].

You can also add a # gql comment at the start of a template string to indicate that its contents should be considered GraphQL syntax.

const query = `# gql
  {
    user(id: ${uid}) {
      firstName
      lastName
    }
  }
`;

Syntax highlighting within .jsx / .tsx files is also supported. These filetypes can be "compound" (javascript.jsx and typescript.tsx) or use the "react" variants (javascriptreact and typescriptreact).

Syntax highlighting is also available within Vue templates.

ReasonML Support

GraphQL syntax support inside of ReasonML template strings using graphql-ppx is available.

[%graphql {|
  query UserQuery {
    user {
      id
      name
    }
  }
|}];

PHP Support

GraphQL syntax inside of heredoc and nowdoc strings is supported. The string identifier must be named GQL (case-insensitive).

<?php
$my_query = <<<GQL
{
  user(id: ${uid}) {
    firstName
    lastName
  }
}
GQL;

Language Server Protocol Support

coc-graphql provides a Language Server Protocol extension for coc.nvim that interoperates with vim-graphql to provide schema-aware features like autocompletion support.

Testing

The test suite uses Vader.vim. To run all of the tests from the command line:

make test

License

This code is released under the terms of the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].