Skip to content

Commit e5db63f

Browse files
committed
Fix clashing package name
1 parent f910eeb commit e5db63f

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# json-to-graphql
1+
# json-to-graphql-query
22

33
This is a simple module that takes a JavaScript object and turns it into a
44
GraphQL query to be sent to a GraphQL server.
@@ -8,15 +8,20 @@ Mainly useful for applications that need to generate graphql queries dynamically
88
## Installation
99

1010
```
11-
npm install json-to-graphql
11+
npm install json-to-graphql-query
1212
```
1313

1414
## Usage
1515

16+
**jsonToGraphQLQuery(** queryObject: object, options?: object **)**
17+
18+
Supported options:
19+
* **pretty**: boolean - Set to `true` to enable pretty-printed output
20+
1621
### Simple Query
1722

1823
```typescript
19-
import { jsonToGraphQL } from 'json-to-graphql';
24+
import jsonToGraphQLQuery from 'json-to-graphql-query';
2025

2126
const query = {
2227
query: {
@@ -27,7 +32,7 @@ const query = {
2732
}
2833
}
2934
};
30-
const graphql_query = jsonToGraphQL(query, { pretty: true });
35+
const graphql_query = jsonToGraphQLQuery(query, { pretty: true });
3136
```
3237

3338
Resulting `graphql_query`
@@ -45,7 +50,7 @@ query {
4550
### Query with arguments
4651

4752
```typescript
48-
import { jsonToGraphQL } from 'json-to-graphql';
53+
import jsonToGraphQLQuery from 'json-to-graphql-query';
4954

5055
const query = {
5156
query: {
@@ -60,7 +65,7 @@ const query = {
6065
}
6166
}
6267
};
63-
const graphql_query = jsonToGraphQL(query, { pretty: true });
68+
const graphql_query = jsonToGraphQLQuery(query, { pretty: true });
6469
```
6570

6671
Resulting `graphql_query`
@@ -78,7 +83,7 @@ query {
7883
### Query with nested objects
7984

8085
```typescript
81-
import { jsonToGraphQL } from 'json-to-graphql';
86+
import jsonToGraphQLQuery from 'json-to-graphql-query';
8287

8388
const query = {
8489
query: {
@@ -93,7 +98,7 @@ const query = {
9398
}
9499
}
95100
};
96-
const graphql_query = jsonToGraphQL(query, { pretty: true });
101+
const graphql_query = jsonToGraphQLQuery(query, { pretty: true });
97102
```
98103

99104
Resulting `graphql_query`

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "json-to-graphql",
2+
"name": "json-to-graphql-query",
33
"version": "0.1.0",
44
"main": "lib/index.js",
55
"license": "MIT",
@@ -10,7 +10,7 @@
1010
"typings": "lib/index.d.ts",
1111
"repository": {
1212
"type": "git",
13-
"url": "https://github.com/dupski/json-to-graphql.git"
13+
"url": "https://github.com/dupski/json-to-graphql-query.git"
1414
},
1515
"devDependencies": {
1616
"@types/chai": "^4.0.10",

0 commit comments

Comments
 (0)