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

coc-apollo

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coc-apollo

coc.nvim extension for Apollo GraphQL

  • 0.4.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
22
increased by2100%
Maintainers
1
Weekly downloads
 
Created
Source

coc-apollo (WIP)

coc.nvim extension for Apollo GraphQL. Still work in progress, feedbacks and PRs are welcome.

Install

:CocInstall coc-apollo

Features

Client Project

  1. GraphQL Language Server: autocomplete, diagnostics...
  2. Apollo GraphQL integration (Use the Apollo schema registry)
    • Graph variants switching
    • Performance stats (require virtual text)
  3. Support loading schema from a remote endpoint, example config
  4. Support loading schema from local: example config

Service project

TODO...

Setup

  1. Add APOLLO_KEY to .env
  2. Add graphql-config for graphql language server
  3. (Optional) Add apollo.config.json or apollo.config.js, config details
  4. (Optional) Use vim-graphql for syntax highlighting

Configure graphql.config.json

The plugin will download schema from Apollo Schema Registry/local schema/remote schema, it generates schema.graphql file by default. So you have to specify "schema": "schema.graphql" in the config in order for language server to read.

Example graphql.config.json

{
  "schema": "schema.graphql"
}

You can also customize the exported schema filename and type with :CocConfig

{
  "apollo.schema.filename": "schema.json"
}

This will output the file in json format by converting the schema to schema introspection

Configurations

apollo.defaultVariant the default apollo graph variant to download when the plugin been initially loaded, default: current

Setup status line

statusline

function! LightlineCocApolloStatus() abort
  let status = get(g:, 'coc_apollo_current_variant', '')
  if empty(status)
    return ''
  endif
  return '🚀 ' . status
endfunction

let g:lightline = {
  \ 'active': {
  \   'left': [
  \     [ 'mode', 'paste' ],
  \     [ 'readonly', 'filename' ]
  \   ],
  \   'right':[
  \     [ 'filetype', 'lineinfo', 'percent', 'cocstatus' ],
  \     [ 'cocapollo' ]
  \   ],
  \ },
  \ 'component_function': {
  \   'cocapollo': 'LightlineCocApolloStatus'
  \ }
\ }

Lists

Show variant list:

:CocList variants

Commands

Reload Apollo graphql schema variant list

:CocCommand apollo.reload.variants

Reload Apollo field stats

:CocCommand apollo.reload.stats

License

MIT


This extension is built with create-coc-extension

Keywords

FAQs

Package last updated on 29 Mar 2022

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