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

Fix usage examples in Readme, closed issues link in Contributing, prettier config and version #138

Merged
merged 7 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Here, indicate the best way to ask questions: via a github issue.

## Opening an Issue

If you think you have found a bug, or have a new feature idea, please start by making sure it hasn't already been [reported or fixed](https//github.com/marmelab/json-graphql-server/issues?q=is%3Aissue+is%3Aclosed). You can search through existing issues and PRs to see if someone has reported one similar to yours.
If you think you have found a bug, or have a new feature idea, please start by making sure it hasn't already been [reported or fixed](https://github.com/marmelab/json-graphql-server/issues?q=is%3Aissue+is%3Aclosed). You can search through existing issues and PRs to see if someone has reported one similar to yours.

Next, create a new issue that briefly explains the problem, and provides a bit of background as to the circumstances that triggered it, and steps to reproduce it.

Expand Down
12 changes: 9 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 4
"bracketSpacing": true,
"printWidth": 80,
"quoteProps": "as-needed",
"rangeStart": 0,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": false
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ format: ## Format the source code
run: ## Launch server with example data
@node ./bin/json-graphql-server.js example/data.js

build:
build: ## Build production release
@NODE_ENV=production ./node_modules/.bin/webpack
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Go to http://localhost:3000/?query=%7B%20Post%28id%3A%201%29%20%7B%20id%20title%

The json-graphql-server accepts queries in GET and POST. Under the hood, it uses [the `express-graphql` module](https://github.com/graphql/express-graphql). Please refer to their documentations for details about passing variables, etc.

Note that the server is [GraphiQL](https://github.com/graphql/graphiql) enabled, so you can query your server using a full-featured graphical user interface, providing autosuggest, history, etc.
Note that the server is [GraphiQL](https://github.com/graphql/graphiql) enabled, so you can query your server using a full-featured graphical user interface, providing autosuggest, history, etc. Just browse http://localhost:3000/ to access it.

![GraphiQL client using json-graphql-server](http://static.marmelab.com/graphiql-json.png)

Expand Down Expand Up @@ -396,7 +396,6 @@ Here is how you can use the queries and mutations generated for your data, using
</pre>
</td>
</tr>

<tr>
<td>
<pre>
Expand Down Expand Up @@ -456,7 +455,7 @@ Useful when using XMLHttpRequest directly or libraries such as [axios](https://w
Add a `script` tag referencing the library:

```html
<script src="../lib/json-graphql-server.min.js"></script>
<script src="../lib/json-graphql-server.client.min.js"></script>
```

It will expose the `JsonGraphqlServer` as a global object:
Expand Down
17 changes: 9 additions & 8 deletions bin/json-graphql-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ var HOST = process.env.NODE_HOST || 'localhost';
var app = express();

process.argv.forEach((arg, index) => {
// allow a custom port via CLI
if (arg === '--p' && process.argv.length > index + 1) {
PORT = process.argv[index + 1];
}
// allow a custom port via CLI
if (arg === '--p' && process.argv.length > index + 1) {
PORT = process.argv[index + 1];
}

if (arg === '--h' && process.argv.length > index + 1) {
HOST = process.argv[index + 1];
}
if (arg === '--h' && process.argv.length > index + 1) {
HOST = process.argv[index + 1];
}
});

app.use(cors());
Expand All @@ -29,5 +29,6 @@ var msg = `GraphQL server running with your data at http://${HOST}:${PORT}/`;
console.log(msg); // eslint-disable-line no-console

process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
// eslint-disable-next-line no-console
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-graphql-server",
"version": "2.3.0",
"version": "2.3.1",
"main": "lib/json-graphql-server.node.min.js",
"browser": "lib/json-graphql-server.client.min.js",
"repository": "[email protected]:marmelab/json-graphql-server.git",
Expand Down