Skip to content

Commit d368b2e

Browse files
committed
Further renames
1 parent e5db63f commit d368b2e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Supported options:
2121
### Simple Query
2222

2323
```typescript
24-
import jsonToGraphQLQuery from 'json-to-graphql-query';
24+
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
2525

2626
const query = {
2727
query: {
@@ -50,7 +50,7 @@ query {
5050
### Query with arguments
5151

5252
```typescript
53-
import jsonToGraphQLQuery from 'json-to-graphql-query';
53+
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
5454

5555
const query = {
5656
query: {
@@ -83,7 +83,7 @@ query {
8383
### Query with nested objects
8484

8585
```typescript
86-
import jsonToGraphQLQuery from 'json-to-graphql-query';
86+
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
8787

8888
const query = {
8989
query: {

src/__tests__/jsonToGraphQL.tests.ts renamed to src/__tests__/jsonToGraphQLQuery.tests.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11

22
import { expect } from 'chai';
3-
import { jsonToGraphQL } from '../jsonToGraphQL';
3+
import { jsonToGraphQLQuery } from '../';
44

55
describe('jsonToGraphQL()', () => {
66

77
it('throws if no query object is specified', () => {
88
expect(() => {
9-
(jsonToGraphQL as any)();
9+
(jsonToGraphQLQuery as any)();
1010
}).to.throw('query object not specified');
1111
});
1212

1313
it('throws if query is not an object', () => {
1414
expect(() => {
15-
jsonToGraphQL('not a query object');
15+
jsonToGraphQLQuery('not a query object');
1616
}).to.throw('query object not specified');
1717
});
1818

1919
it('throws if object has no keys', () => {
2020
expect(() => {
21-
jsonToGraphQL({});
21+
jsonToGraphQLQuery({});
2222
}).to.throw('query object has no data');
2323
});
2424

@@ -32,7 +32,7 @@ describe('jsonToGraphQL()', () => {
3232
}
3333
}
3434
};
35-
expect(jsonToGraphQL(query, { pretty: true })).to.equal(
35+
expect(jsonToGraphQLQuery(query, { pretty: true })).to.equal(
3636
`query {
3737
Posts {
3838
id
@@ -56,7 +56,7 @@ describe('jsonToGraphQL()', () => {
5656
}
5757
}
5858
};
59-
expect(jsonToGraphQL(query, { pretty: true })).to.equal(
59+
expect(jsonToGraphQLQuery(query, { pretty: true })).to.equal(
6060
`query {
6161
Posts (orderBy: "post_date", userId: 12) {
6262
id
@@ -80,7 +80,7 @@ describe('jsonToGraphQL()', () => {
8080
}
8181
}
8282
};
83-
expect(jsonToGraphQL(query, { pretty: true })).to.equal(
83+
expect(jsonToGraphQLQuery(query, { pretty: true })).to.equal(
8484
`query {
8585
Posts {
8686
id
@@ -115,7 +115,7 @@ describe('jsonToGraphQL()', () => {
115115
}
116116
}
117117
};
118-
expect(jsonToGraphQL(query, { pretty: true })).to.equal(
118+
expect(jsonToGraphQLQuery(query, { pretty: true })).to.equal(
119119
`query {
120120
Posts (arg1: 20, arg2: "flibble") {
121121
id

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
export * from './jsonToGraphQL';
2+
export * from './jsonToGraphQLQuery';

src/jsonToGraphQL.ts renamed to src/jsonToGraphQLQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface IJsonToGraphQLOptions {
3535
pretty?: boolean;
3636
}
3737

38-
export function jsonToGraphQL(query: any, options: IJsonToGraphQLOptions = {}) {
38+
export function jsonToGraphQLQuery(query: any, options: IJsonToGraphQLOptions = {}) {
3939
if (!query || typeof query != 'object') {
4040
throw new Error('query object not specified');
4141
}

0 commit comments

Comments
 (0)