Skip to content
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

feat: add basic tooling setup #103

Merged
merged 3 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,10 @@ The following is an example using `clientA` instead of the default client:
`, null, { clientId: 'clientA' })
...
```

## Tooling

An `apollo.config.js` configuration file for [Apollo GraphQL VSCode extension](https://www.apollographql.com/docs/devtools/editor-plugins/) ((`apollographql.vscode-apollo`)) will be automatically scaffolded.

You should fill in the `client.server.url` property with the URL of the server exposing your GraphQL schema.
This extension will automatically connect to your remote server, read your GraphQL schema and provide autocomplete/schema errors detection for your GraphQL queries.
IlCallo marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 14 additions & 0 deletions lib/templates/apollo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'
/* eslint-env node */
// See https://www.apollographql.com/docs/devtools/apollo-config/
module.exports = {
client: {
service: {
name: 'my-service',
// URL to the GraphQL API
url: 'http://localhost:3000/graphql',
},
// Files processed by the extension
includes: ['src/**/*.vue', 'src/**/*.js', 'src/**/*.ts'],
},
}
IlCallo marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ module.exports = function (api) {
} else {
api.render('../lib/templates')
}

api.extendJsonFile('.vscode/extensions.json', {
recommendations: ['apollographql.vscode-apollo'],
})
}
13 changes: 13 additions & 0 deletions src/templates/apollo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-env node */
// See https://www.apollographql.com/docs/devtools/apollo-config/
module.exports = {
client: {
service: {
name: 'my-service',
// URL to the GraphQL API
IlCallo marked this conversation as resolved.
Show resolved Hide resolved
url: 'http://localhost:3000/graphql',
},
// Files processed by the extension
includes: ['src/**/*.vue', 'src/**/*.js', 'src/**/*.ts'],
},
}