-
Notifications
You must be signed in to change notification settings - Fork 463
Add README for the VS Code extension #521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
14153df
d5fd31b
87f544b
ed71c03
ee9935b
4da126e
3efa9ad
46628f3
7344217
c8fc1dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Apollo VSCode | ||
|
|
||
| An all-in-one tooling experience for developing apps with Apollo | ||
|
|
||
| - Get instant feedback and intelligent autocomplete as you write queries | ||
| - Run queries against your GraphQL server without leaving your editor | ||
| - View performance statistics next to your query definitions | ||
|
|
||
|  | ||
|  | ||
|  | ||
|
|
||
| ## Features | ||
|
|
||
| - Loads your GraphQL schemas and queries automatically from an [Apollo Config](https://github.com/apollographql/apollo-cli/blob/master/packages/apollo-cli/README.md#configuration) file | ||
| - Adds syntax highlighting for GraphQL files and `gql` templates inside JavaScript files | ||
| - Code-completes fields, arguments, types, and variables in your queries | ||
| - Lets you run queries, mutations, and subscriptions within the IDE with code-completion for variables | ||
| - Displays performance statistics from [Apollo Engine](https://www.apollographql.com/engine) inline with your queries | ||
| - Jump-to-definition for fragments and schema types | ||
| - Detects fragment references and shows them next to definitions | ||
|
|
||
| ## How to get it? | ||
|
|
||
| Open up VS Code and search for the extension "Apollo". | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this extension conflict with any other GraphQL extensions you have installed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably, since both register a GraphQL syntax. Should I add a line to warn users about installing it alongside other extensions? |
||
|
|
||
| ## How to get it set up? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about uploading your schema to Engine? What if you're not running your GraphQL server locally? |
||
|
|
||
| The extension searches for [Apollo Config](https://github.com/apollographql/apollo-cli/blob/master/packages/apollo-cli/README.md#configuration) definitions in `package.json` or `apollo.config.js` files. To set up a basic endpoint and queries defined in `.tsx` files, a config file would look like. | ||
|
|
||
| ```js | ||
| // package.json | ||
|
|
||
| { | ||
| ..., | ||
| "apollo": { | ||
| "schemas": { | ||
| "mainSchema": { | ||
| "endpoint": "http://localhost:4000/graphql" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## How do we run queries? | ||
|
|
||
| The extension enables query execution when an `endpoint` is specified for the schema you are targeting. When you hit `Run query/mutations/subscription`, the extension will open a menu for you to input variables if there are any defined or directly run the query otherwise. | ||
|
|
||
| Queries and mutations are executed the same network interface as Apollo Client. Subscriptions are configured to run against the `subscriptions` key in your schema or your endpoint with `http` replaced by `ws` if the key is not defined. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Extension not starting correctly? Check the logs! | ||
|
|
||
| If you're having trouble with the extension not launching or not detecting your configuration files, you can check the language server logs. | ||
|
|
||
| 1. Open the VS Code output tab by running the command "View: Toggle Output" | ||
| 2. Switch the output view to "Apollo GraphQL" | ||
| 3. Check the logs and report any bugs you find! | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this extension work with non-Apollo GraphQL servers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Is there somewhere we can make this more clear?