chipsenkbeil / vimwiki.nvim

Neovim plugin that offers enhanced and alternative functionality for the vimwiki language.
BSD 2-Clause "Simplified" License
50 stars 0 forks source link

Support sending user-defined graphql queries #24

Open chipsenkbeil opened 3 years ago

chipsenkbeil commented 3 years ago

Currently, the plugin doesn't expose the ability to send graphql queries in a very friendly format.

It would be nice to support this for both Lua and vimscript with the vimscript version obviously calling into Lua.

" Async version that takes the query string and some function to invoke with data/err response
" It might be good to also expose
vimwiki_server#api#send('{...}', data, err -> { ... })

" Sync version that blocks until a reponse is retrieved or a timeout is reached, filling in the err for timeout
" Return is a dict of data/err
let results = vimwiki_server#api#send_wait('{...}')

" Support method to build a query
let query = vimwiki_server#utils#new_query('get(name: $name) { ... }', {'name': 'some name'})