Giter Site home page Giter Site logo

ruanyl / coc-apollo Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 699 KB

coc.nvim extension for GraphQL/Apollo GraphQL

License: MIT License

TypeScript 94.93% JavaScript 5.07%
vim apollographql graphql neovim plugin nvim-extension coc-apollo apollo-schema-registry graphql-language-server

coc-apollo's Introduction

Hey, I'm Yulong ๐Ÿ‘‹

coc-apollo's People

Contributors

dependabot[bot] avatar ruanyl avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coc-apollo's Issues

No Apollo service name found

Hi, and thanks for making this plugin, looking forward to it!

After installing it, I'm seeing this error in my coc log:

2021-02-15T09:13:11.441 ERROR (pid:24749) [extensions] - Error on active extension coc-apollo-graphql: CocApolloGraphqlExtensionError: No Apollo service name found
    at loadConfig (/home/dori/.config/coc/extensions/node_modules/coc-apollo-graphql/lib/index.js:38127:11)
    at Object.activate (/home/dori/.config/coc/extensions/node_modules/coc-apollo-graphql/lib/index.js:38861:30)
    at Object.activate (/home/dori/.vim/plugged/coc.nvim/build/index.js:228:1333)
    at t9.activate (/home/dori/.vim/plugged/coc.nvim/build/index.js:225:7211)
    at t9.setupActiveEvents (/home/dori/.vim/plugged/coc.nvim/build/index.js:225:10490)
    at t9.activateExtensions (/home/dori/.vim/plugged/coc.nvim/build/index.js:224:17268)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async MP.init (/home/dori/.vim/plugged/coc.nvim/build/index.js:254:5524)
    at async /home/dori/.vim/plugged/coc.nvim/build/index.js:129:13445 CocApolloGraphqlExtensionError: No Apollo service name found
    at loadConfig (/home/dori/.config/coc/extensions/node_modules/coc-apollo-graphql/lib/index.js:38127:11)
    at Object.activate (/home/dori/.config/coc/extensions/node_modules/coc-apollo-graphql/lib/index.js:38861:30)
    at Object.activate (/home/dori/.vim/plugged/coc.nvim/build/index.js:228:1333)
    at t9.activate (/home/dori/.vim/plugged/coc.nvim/build/index.js:225:7211)
    at t9.setupActiveEvents (/home/dori/.vim/plugged/coc.nvim/build/index.js:225:10490)
    at t9.activateExtensions (/home/dori/.vim/plugged/coc.nvim/build/index.js:224:17268)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async MP.init (/home/dori/.vim/plugged/coc.nvim/build/index.js:254:5524)
    at async /home/dori/.vim/plugged/coc.nvim/build/index.js:129:13445
2021-02-15T09:13:11.793 INFO (pid:24749) [plugin] - coc.nvim 0.0.80-fff2a86b16 initialized with node: v15.8.0 after 484ms
2021-02-15T09:13:13.501 INFO (pid:24749) [language-client-index] - eslint started with 24865
2021-02-15T09:13:13.517 INFO (pid:24749) [language-client-index] - tailwindCSS started with 24873
2021-02-15T09:13:13.528 INFO (pid:24749) [services] - registered service "tsserver"
2021-02-15T09:13:17.233 INFO (pid:24749) [attach] - receive notification: openLog []

Checking out the code, it seems like you're trying to extract the service name from the APOLLO_KEY string?
https://github.com/ruanyl/coc-apollo-graphql/blob/1cc73881dbf983d86ac3e9c5575f7d5c428d57e2/src/utils.ts#L1

My .env settings looks like APOLLO_KEY=user:gh.AdrienLemaire:iatBC...5F, which, is completely different from my service name defined in apollo.config.js

module.exports = {
  client: {
    name: "Project [web]",
    service: {
      name: "project", // <= That's my service name
      url: process.env.GRAPHQL_URI || "http://localhost:4001/graphql",
      skipSSLValidation: true,
    },
    excludes: ["**/__tests__/**/*"],
  },
};

List variants not found

hi @ruanyl , and thanks for keeping adding new features to the plugin <3
Could you also add git tags when releasing ? Since I'm watching the releases for this repo, I'd be able to follow new features as you release them.

I'm now using [email protected], and trying to setup my status line (really needed a good way to switch from production to local schema, so many thanks for that!).
But I cannot see the variant in my statusline, and debugging further, g:coc_apollo_current_variant doesn't exist and :CocList variants returns [coc.nvim] List variants not found.

In addition, stats stopped showing up on graphql queries.

:CocList variants
[coc.nvim] List variants not found
:CocCommand apollo.reload.variants
[coc.nvim] Command: apollo.reload.variants not found
:CocCommand apollo.reload.stats
[coc.nvim] Command: apollo.reload.stats not foun
:CocList extensions
+ coc-apollo 0.4.1 ~/.config/coc/extensions/node_modules/coc-apollo

.env contains APOLLO_KEY with apollo studio key

.graphqlconfig (Might you be expecting a graphql.config.json instead of a .graphqlconfig file ?)

{
  "schemaPath": "./schema.graphql"
}

.vim/coc-settings.json

{
  ...
  "apollo.enabled": true,
  "apollo.defaultVariant": "current"
}

I noticed that you added Add graphql-config for graphql language server in the Setup requirements, and tried installing it in my repo with npm i -E -D graphql-config, but it doesn't have any effect. Are you expecting a global install ? Why can't coc-apollo install it by itself ?

Looking forward to getting this plugin working back again ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.