{"id":13479700,"url":"https://github.com/jparise/vim-graphql","last_synced_at":"2025-05-15T17:03:53.678Z","repository":{"id":3234856,"uuid":"48825649","full_name":"jparise/vim-graphql","owner":"jparise","description":"A Vim plugin that provides GraphQL file detection, syntax highlighting, and indentation.","archived":false,"fork":false,"pushed_at":"2025-04-27T11:44:46.000Z","size":175,"stargazers_count":502,"open_issues_count":0,"forks_count":25,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-27T12:21:43.563Z","etag":null,"topics":["graphql","graphql-schema","neovim","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jparise.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jparise"}},"created_at":"2015-12-31T00:44:29.000Z","updated_at":"2025-04-27T11:44:49.000Z","dependencies_parsed_at":"2024-09-27T21:40:39.191Z","dependency_job_id":"97587e06-8bb9-4ac7-be66-0027e67822b9","html_url":"https://github.com/jparise/vim-graphql","commit_stats":{"total_commits":165,"total_committers":14,"mean_commits":"11.785714285714286","dds":"0.12727272727272732","last_synced_commit":"9caa247f88991ebfa45df21cbe1c8bec50039f6b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparise%2Fvim-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparise%2Fvim-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparise%2Fvim-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jparise%2Fvim-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jparise","download_url":"https://codeload.github.com/jparise/vim-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384983,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","graphql-schema","neovim","vim"],"created_at":"2024-07-31T16:02:21.637Z","updated_at":"2025-05-15T17:03:53.673Z","avatar_url":"https://github.com/jparise.png","language":"Vim Script","readme":"# GraphQL for Vim\n\nThis Vim plugin provides [GraphQL](https://graphql.org/) file detection, syntax\nhighlighting, and indentation. It currently targets the [October 2021\nEdition](https://spec.graphql.org/October2021/) of the GraphQL specification.\n\nThe core runtime files are also included with Vim 9.1.0955+. They provide the\nfoundational support (ftplugin, indent, syntax) for the `graphql` filetype.\nThis plugin includes the most up-to-date version of those runtime files as well\nas support for embedding GraphQL syntax inside of other filetype buffers (such\nas JavaScript).\n\n## Installation\n\nThis plugin requires Vim version 8.2 or later. Equivalent Neovim versions\nare also supported.\n\n### Using [vim-plug](https://github.com/junegunn/vim-plug)\n\n1. Add `Plug 'jparise/vim-graphql'` to `~/.vimrc`\n2. `vim +PluginInstall +qall`\n\n### Using Vim Packages\n\n```sh\nmkdir -p ~/.vim/pack/jparise/start\ncd ~/.vim/pack/jparise/start\ngit clone https://github.com/jparise/vim-graphql.git graphql\nvim -u NONE -c \"helptags graphql/doc\" -c q\n```\n\n## Syntax Highlighting\n\nComplete syntax highlighting is enabled for the `graphql` [filetype][]. This\nfiletype is automatically selected for filenames ending in `.gql`, `.graphql`,\nand `.graphqls`.\n\nIf you would like to enable automatic syntax support for more file extensions\n(e.g., `*.prisma`), create a file named `~/.vim/after/ftdetect/graphql.vim`\ncontaining autocommand lines like:\n\n```vim\nau BufNewFile,BufRead *.prisma setfiletype graphql\n```\n\n[filetype]: http://vimdoc.sourceforge.net/htmldoc/filetype.html\n\n## JavaScript and TypeScript Support\n\nGraphQL syntax support inside of [ES2015 template literals][templates] is\nprovided. It works \"out of the box\" with Vim 8.2+'s JavaScript and TypeScript\nlanguage support. The extended JavaScript syntax provided by the\n[vim-javascript][] plugin is also supported.\n\nFor older versions of Vim, TypeScript support can be enabled by installing the\n[yats][] plugin.\n\n[templates]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates\n[vim-javascript]: https://github.com/pangloss/vim-javascript\n[yats]: https://github.com/HerringtonDarkholme/yats.vim\n\n```javascript\nconst query = gql`\n  {\n    user(id: ${uid}) {\n      firstName\n      lastName\n    }\n  }\n`;\n```\n\nThe list of recognized tag names is defined by the `g:graphql_javascript_tags`\nvariable, which defaults to `[\"gql\", \"graphql\", \"Relay.QL\"]`. This can also\nbe set on a per-buffer basis using the `b:graphql_javascript_tags` variable.\n\nUntagged template literals passed as the first argument to specific functions\ncan also be recognized. `g:graphql_javascript_functions` defines this list of\nfunctions, which defaults to `[\"graphql\"]`. This list can also be set on a\nper-buffer basis using the `b:graphql_javascript_functions` variable.\n\n```javascript\nconst query = graphql(`\n  {\n    user(id: ${uid}) {\n      firstName\n      lastName\n    }\n  }\n`);\n```\n\nYou can also add a `# gql` or `# graphql` comment at the start of a template\nstring to indicate that its contents should be considered GraphQL syntax.\n\n```javascript\nconst query = `# gql\n  {\n    user(id: ${uid}) {\n      firstName\n      lastName\n    }\n  }\n`;\n```\n\nSyntax highlighting within `.jsx` / `.tsx` files is also supported. These\nfiletypes can be \"compound\" (`javascript.jsx` and `typescript.tsx`) or use the\n\"react\" variants (`javascriptreact` and `typescriptreact`).\n\nSyntax highlighting is also available within [Vue](https://vuejs.org/)\ntemplates.\n\n## ReasonML Support\n\nGraphQL syntax support inside of [ReasonML](https://reasonml.org/) template\nstrings using [graphql-ppx][] is available.\n\n```reason\n[%graphql {|\n  query UserQuery {\n    user {\n      id\n      name\n    }\n  }\n|}];\n```\n\nThe `%relay` extension point is also supported.\n\n[graphql-ppx]: https://github.com/reasonml-community/graphql-ppx\n\n## ReScript Support\n\nGraphQL syntax support inside of [ReScript](https://rescript-lang.org/)\nstrings is available.\n\n```rescript\n%graphql(`\n  query UserQuery {\n    user {\n      id\n      name\n    }\n  }\n`)\n```\n\nThe [`%relay` extension node][%relay] is also supported.\n\n[%relay]: https://rescript-relay-documentation.vercel.app/docs/making-queries\n\n## PHP Support\n\nGraphQL syntax inside of [heredoc][] and [nowdoc][] strings is supported. The\nstring identifier must be named `GQL` (case-insensitive).\n\n```php\n\u003c?php\n$my_query = \u003c\u003c\u003cGQL\n{\n  user(id: ${uid}) {\n    firstName\n    lastName\n  }\n}\nGQL;\n```\n\n[heredoc]: https://www.php.net/manual/language.types.string.php#language.types.string.syntax.heredoc\n[nowdoc]: https://www.php.net/manual/language.types.string.php#language.types.string.syntax.nowdoc\n\n## Language Server Protocol Support\n\n[Language Server Protocol (LSP)](https://langserver.org/) implementations can\nenable editor features like schema-aware completion. This plugin does not\nimplement the Language Server Protocol, but here are some others that do:\n\n- [coc.nvim](https://github.com/neoclide/coc.nvim) supports\n  [GraphQL language servers](https://github.com/neoclide/coc.nvim/wiki/Language-servers#graphql)\n\n## Testing\n\nThe test suite uses [Vader.vim](https://github.com/junegunn/vader.vim). To run\nall of the tests from the command line:\n\n```sh\nmake test\n```\n\n## License\n\nThis code is released under the terms of the MIT license. See `LICENSE` for\ndetails.\n","funding_links":["https://github.com/sponsors/jparise"],"categories":["Vim Script","Tools","Vim script"],"sub_categories":["Julia Libraries","Tools - Editor Plugins","Crystal Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjparise%2Fvim-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjparise%2Fvim-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjparise%2Fvim-graphql/lists"}