Coder Social home page Coder Social logo

atom-graphql-autocomplete's People

Contributors

dependabot[bot] avatar elitan avatar nicolaslopezj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

atom-graphql-autocomplete's Issues

Version 1.03 with Atom 1.19 breaks

Getting these errors since updating to Atom 1.19 (macOS):

LinterError TypeError: Cannot read property 'join' of undefined
    at Linter.<anonymous> (/Users/chris/.atom/packages/graphql-autocomplete/lib/Linter/index.js:57:46)
    at Generator.next (<anonymous>)
    at step (/Users/chris/.atom/packages/graphql-autocomplete/lib/Linter/index.js:9:273)
    at /Users/chris/.atom/packages/graphql-autocomplete/lib/Linter/index.js:9:443
    at Linter.<anonymous> (/Users/chris/.atom/packages/graphql-autocomplete/lib/Linter/index.js:9:99)
    at promises.push.Promise.then._this2.emitter.emit.number (/Users/chris/.atom/packages/linter/lib/linter-registry.js:101:24)
    at _loop (/Users/chris/.atom/packages/linter/lib/linter-registry.js:99:21)
    at LinterRegistry.<anonymous> (/Users/chris/.atom/packages/linter/lib/linter-registry.js:87:40)
    at Generator.next (<anonymous>)
    at LinterRegistry.<anonymous> (/Users/chris/.atom/packages/linter/lib/linter-registry.js:143:4)
    at Generator.next (<anonymous>)
    at step (/Users/chris/.atom/packages/linter/lib/linter-registry.js:5:273)
    at /Users/chris/.atom/packages/linter/lib/linter-registry.js:5:443
    at LinterRegistry.<anonymous> (/Users/chris/.atom/packages/linter/lib/linter-registry.js:5:99)
    at /Users/chris/.atom/packages/linter/lib/main.js:125:30
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at /Users/chris/.atom/packages/linter/lib/editor-linter.js:32:22
    at later (/Users/chris/.atom/packages/linter/node_modules/sb-debounce/index.js:9:14)
Uncaught (in promise) TypeError: Cannot read property '4' of undefined
    at Snippets.getLine (/Users/chris/.atom/packages/graphql-autocomplete/lib/Snippets/index.js:13:31)
    at Snippets.<anonymous> (/Users/chris/.atom/packages/graphql-autocomplete/lib/Snippets/index.js:17:27)
    at Generator.next (<anonymous>)
    at step (/Users/chris/.atom/packages/graphql-autocomplete/lib/Snippets/index.js:9:273)
    at /Users/chris/.atom/packages/graphql-autocomplete/lib/Snippets/index.js:9:443
    at Snippets.<anonymous> (/Users/chris/.atom/packages/graphql-autocomplete/lib/Snippets/index.js:9:99)
    at /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:337:60
    at Array.forEach (native)
    at AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:313:23)
    at AutocompleteManager.findSuggestions (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:302:25)

jams atom

If I start typing gql template literals, atom jams up and doesn't become responsive again. :(

Feature Request: Support for .graphqlconfig

It seems that there is a consensus towards using a .graphqlconfig file rather than a .graphqlrc file in graphql projects.

I think it would be a good idea to migrate this project to use the new configuration file to be consistent with other projects. Currently in my personal projects I have to maintain two different configuration files in order to use this package.

Further Reading

How to activate

Hi,
i've created the .graphqlrc file as suggested:

{
  "request": {
    "url": "http://app.dev.local/graphql"
  }
}

When i open a .graphql file nothing happen.

It seems that the .graphqlrc file is never readed. I tried to mess with the file to see if any errors blow up but nothing seems to happen.

Dynamic .graphqlrc ?

First of all, this is awesome, thank you for putting this together! ๐ŸŽ‰

I have a use case where I need to point the local app to different graphql endpoints/servers (e.g. staging, dev, production, etc) to test out features and schema changes as they're being developed. Is there any way to have the .graphqlrc take in some environment variable? Or could it be a JS file that's imported and executed by this plugin to get the graphql server at runtime?

Happy to contribute this as a PR as well, just point me in the right direction! :)

Feature request: indicate when schema fetch failed

I tried putting some wrong port into my .graphqlrc and there is no indication that the schema failed to load from that url. Would be nice to display just a warning toast message or maybe some in the status bar?
I don't really care where, but it would be nice to let the user know his URL is wrong.

Failed to load the graphql-autocomplete package

[Enter steps to reproduce:]

  1. Update to version 1.3.0 (from 1.1.0)
  2. Error on every Atom launch

Atom: 1.40.1 x64
Electron: 3.1.10
OS: Microsoft Windows 10 Pro
Thrown From: graphql-autocomplete package 1.3.0

Stack Trace

Failed to load the graphql-autocomplete package

At regeneratorRuntime is not defined

ReferenceError: regeneratorRuntime is not defined
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:69:7
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:193:6
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:451:2)
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:454:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/index.js:103:31)
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/index.js:104:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/graphql-autocomplete/lib/Snippets/getSnippets.js:11:40)
    at /packages/graphql-autocomplete/lib/Snippets/getSnippets.js:54:2)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/graphql-autocomplete/lib/Snippets/index.js:13:20)

Commands

Non-Core Packages

atom-ternjs 0.18.3 
autocomplete-modules 1.12.0 
busy-signal 1.4.3 
convert-file-encoding 0.1.0 
docblockr 0.13.7 
Fast_Duplicate 1.2.0 
git-log 0.4.1 
graphql-autocomplete 1.3.0 
hyperclick 0.1.5 
intentions 1.1.5 
js-hyperclick 1.14.2 
js-hyperclick-project-path 1.12.0 
language-babel 2.85.0 
language-graphql 1.0.0 
language-javascript-jsx 0.3.7 
linter 2.2.0 
linter-eslint 8.4.1 
linter-ui-default 1.7.1 
react 0.18.0 
react-snippets 1.1.1 
split-diff 1.5.3 
Sublime-Style-Column-Selection 1.7.5 
sync-settings 0.8.6 
tabs-to-spaces 1.0.5 
yui-doc-snippets 0.1.0 

From file example

Hello! Could you please provide an example of a file with schemas?

And thanks for awesome work!

No Authentication?

Unfortunately I can't use this tool, because headers have to be passed.
Can you include an option for this? :)

Fragment definitions inlining

Using apollo client you should be able to do this

const fragments = gql`
  fragment Details on ContentType {
    ...DetailsEditor on ContentType
    ...DetailsViewer on ContentType
  }
  ${DetailsEditor.fragments.ContentType}
  ${DetailsViewer.fragments.ContentType}
`

However the plugin is annoyed with ${}.
Error:

Syntax Error GraphQL (6:3) Unexpected $

5:   }
6:   ${DetailsEditor.fragments.ContentType}
     ^
7:   ${DetailsViewer.fragments.ContentType}
: /Users/grumpyOldRussian/Documents/web-projects/med-yacht-sales/mys-cms-frontend/src/modules/content-type-editor/details/Details.js:12

Failed to load the graphql-autocomplete package

[Enter steps to reproduce:]

Looks like there may need to be an upgrade for 1.4

  1. ...
  2. ...

Atom: 1.40.1 x64
Electron: 3.1.10
OS: Mac OS X 10.14.6
Thrown From: graphql-autocomplete package 1.3.0

Stack Trace

Failed to load the graphql-autocomplete package

At regeneratorRuntime is not defined

ReferenceError: regeneratorRuntime is not defined
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:69:7
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:193:6
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:451:2)
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js:454:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146745)
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/index.js:103:31)
    at /packages/graphql-autocomplete/node_modules/graphql-language-service-interface/dist/index.js:104:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146745)
    at /packages/graphql-autocomplete/lib/Snippets/getSnippets.js:11:40)
    at /packages/graphql-autocomplete/lib/Snippets/getSnippets.js:54:2)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146745)
    at /packages/graphql-autocomplete/lib/Snippets/index.js:13:20)

Commands

Non-Core Packages

angularjs 0.5.3 
atom-beautify 0.33.4 
atom-ide-debugger-node 0.7.3 
atom-ide-debugger-python 0.7.3 
atom-ide-debugger-react-native 0.7.3 
atom-ide-ui 0.13.0 
atom-prettify 0.1.3 
autocomplete-python 1.16.0 
graphql-autocomplete 1.3.0 
ide-python 1.4.2 
kite 0.172.0 
language-cypher 0.5.0 
language-graphql 1.0.0 
language-scala 1.1.10 
language-sparql 0.3.0 
markdown-preview-plus 3.10.0 
minimap 4.29.9 
pretty-json 2.1.2 
react 0.18.0 
split-diff 1.6.1 
xml-formatter 0.13.0 

RFC: Global atom-configuration

This plugin is great when working on projects that might potentially be consuming queries from disparate GraphQL servers, or when working with other developers that use atom, however the .graphqlrc convention tends to lose its luster when working on larger projects with a more diverse developer base.

I propose that a new, atom-based setting be exposed that allows users to define a "global" HTTP server or JSON file for building the autocomplete. This way atom users can continue to enjoy the benefit of this plugin without burdening project maintainers with another file.

With this change in mind, when the plugin begins, it will:

  • Look for a .graphqlrc file with the appropriate schematic, as defined in the README.
  • Failing that, will try and look for a atom-config setting for it to operate off of.

Open Questions:

  • Is it possible to have a per-project atom setting?
  • When do we want to communicate failures? (IE: if a .graphqlrc is present, but doesn't conform to the shape as outlined in documentation).

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.