jparise/vim-graphql

Support for custom extensions

flsilva opened this issue · 1 comments

Hi! Thanks for your plugin!

Is it possible to add support for other extensions? I'm working with graph.cool BaaS and they create a file named project.graphcool for custom user types (schema.graphql is used for built-in types). I've tried using their --output flag when creating new projects like graphcool init --output 'my-schema.graphql' but it didn't work, i.e., resulted in project.graphcool anyway.

You can add custom file type detection pretty easily. Create a new file named ~/.vim/ftdetect/graphcool.vim containing:

au BufNewFile,BufRead project.graphcool setfiletype graphql

I'm not sure it makes sense to add built-in support for project.graphcool to the stock plugin at this point, but the above should get you going.