Neovim nvim-cmp source for graphql completions based on schema
phenax/cmp-graphql
using your plugin managerExample -
use 'phenax/cmp-graphql'
cmp.setup({
-- ...
sources = {
-- ...
{ name = 'graphql' }
}
})
Install @graphql-codegen/cli
yarn add -D @graphql-codegen/cli
Run codegen init to setup the codegen config file
NOTE: Make sure introspection json is enabled. The only relevant generated file is the schema json file.
yarn graphql-codegen init
yarn && yarn codegen
require('cmp-graphql').setup({
schema_path = 'graphql.schema.json', -- Path to generated json schema file in project
})