Skip to content

Commit 88f6389

Browse files
committed
Update README and CHANGELOG
1 parent 4b456ee commit 88f6389

11 files changed

+22
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11

22
# json-to-graphql-query Changelog
33

4+
## 1.9.0
5+
6+
* Added support for array values. We now use the first object found in an array for the
7+
node names. If the array does not contain an object, we just return the corresponding key.
8+
* Added `includeFalsyKeys` option, to disable the default behaviour of excluding keys with falsy values.
9+
Thanks @bret-hubbard for both of these additions :)
10+
411
## 1.8.0
512

613
* Added support for Inline Fragments. Thanks again @jeniffer9 :)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const query = jsonToGraphQLQuery(queryObject: object, options?: object);
2020
Supported Options:
2121
* `pretty` - boolean - optional - set to `true` to enable pretty-printed output
2222
* `ignoreFields` - string[] - optional - you can pass an array of object key names that you want removed from the query
23+
* `includeFalsyKeys` - boolean - optional - disable the default behaviour if excluding keys with a falsy value
2324

2425
## Features
2526

@@ -171,6 +172,8 @@ query {
171172
}
172173
}
173174
```
175+
NOTE: You can tell jsonToGraphQLQuery() not to exclude keys with a falsy value
176+
by setting the `includeFalsyKeys` option.
174177

175178
### Using aliases
176179

src/__tests__/aliases.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - aliases', () => {
5+
describe('jsonToGraphQLQuery() - aliases', () => {
66

77
it('uses aliases for fields', () => {
88
// Deprecated...

src/__tests__/arguments.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - arguments', () => {
5+
describe('jsonToGraphQLQuery() - arguments', () => {
66

77
it('converts a query with simple arguments', () => {
88
const query = {

src/__tests__/directives.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - directives', () => {
5+
describe('jsonToGraphQLQuery() - directives', () => {
66

77
it('converts a simple query with args and directives with no arguments', () => {
88
const query = {

src/__tests__/falsykeys.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - falsy keys', () => {
5+
describe('jsonToGraphQLQuery() - falsy keys', () => {
66

77
it('does not include fields which value is false', () => {
88
const query = {

src/__tests__/fragments.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - fragments', () => {
5+
describe('jsonToGraphQLQuery() - fragments', () => {
66

77
it('supports inline fragments', () => {
88
const query = {

src/__tests__/ignorefields.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - ignoreFields option', () => {
5+
describe('jsonToGraphQLQuery() - ignoreFields option', () => {
66

77
it('ignores a field that exists in the initial object', () => {
88
const query = {

src/__tests__/mutations.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - mutations', () => {
5+
describe('jsonToGraphQLQuery() - mutations', () => {
66

77
it('correctly converts mutations with no specified return fields', () => {
88
const query = {

src/__tests__/nodes.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { expect } from 'chai';
33
import { jsonToGraphQLQuery } from '../';
44

5-
describe('jsonToGraphQL() - node conversion', () => {
5+
describe('jsonToGraphQLQuery() - node conversion', () => {
66

77
it('throws if no query object is specified', () => {
88
expect(() => {

0 commit comments

Comments
 (0)