diff --git a/README.md b/README.md index 9a6edb6..c2f95a7 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ query someQuery($argValue: String! $shouldKeep: Boolean!) { } ``` -If `shouldKeep` in this example is true, it will remove the whole `field` query including arguments. +If `$shouldKeep` in this example is `false`, it will remove the whole `field` query including arguments. It will also clean up all variables that might be used (if not used by other fields). To prevent Apollo Cache issues it will fill the field with `null` when returned from the server. diff --git a/src/apollo/__tests__/KeepLink.spec.ts b/src/apollo/__tests__/KeepLink.spec.ts index aca32c4..4b0accd 100644 --- a/src/apollo/__tests__/KeepLink.spec.ts +++ b/src/apollo/__tests__/KeepLink.spec.ts @@ -3,7 +3,7 @@ import { print } from 'graphql/language/printer' import { removeIgnoreSetsFromDocument } from '../KeepLink' import { setInObject } from '../utils' -describe('IgnoreLink', () => { +describe('KeepLink', () => { const query = gql` query someQuery($shouldKeep: Boolean!) { test { diff --git a/src/apollo/__tests__/__snapshots__/KeepLink.spec.ts.snap b/src/apollo/__tests__/__snapshots__/KeepLink.spec.ts.snap index 59f633c..2a6cff8 100644 --- a/src/apollo/__tests__/__snapshots__/KeepLink.spec.ts.snap +++ b/src/apollo/__tests__/__snapshots__/KeepLink.spec.ts.snap @@ -13,7 +13,7 @@ exports[` 1`] = ` " `; -exports[`IgnoreLink Aliases should properly map aliases 1`] = ` +exports[`KeepLink Aliases should properly map aliases 1`] = ` "query someQuery { aliasForDeeply: deeply { nested { @@ -26,7 +26,7 @@ fragment someOtherFragment on Type " `; -exports[`IgnoreLink Field Arguments should keep variables if they are used elsewhere 1`] = ` +exports[`KeepLink Field Arguments should keep variables if they are used elsewhere 1`] = ` "query someQuery($argValue: String!) { someOther { subFieldOther(someArg: $argValue) { @@ -37,7 +37,7 @@ exports[`IgnoreLink Field Arguments should keep variables if they are used elsew " `; -exports[`IgnoreLink Field Arguments should remove argument variables if exists 1`] = ` +exports[`KeepLink Field Arguments should remove argument variables if exists 1`] = ` "query someQuery { someOther { subFieldOther @@ -46,7 +46,7 @@ exports[`IgnoreLink Field Arguments should remove argument variables if exists 1 " `; -exports[`IgnoreLink Fragment should work with fragments 1`] = ` +exports[`KeepLink Fragment should work with fragments 1`] = ` "query someQuery { deeply { nested { @@ -59,7 +59,7 @@ fragment queryFragment on Type " `; -exports[`IgnoreLink should remove directives and fields if shouldKeep is false 1`] = ` +exports[`KeepLink should remove directives and fields if shouldKeep is false 1`] = ` "query someQuery { test { some @@ -68,7 +68,7 @@ exports[`IgnoreLink should remove directives and fields if shouldKeep is false 1 " `; -exports[`IgnoreLink should should keep fields, but remove directives if shouldKeep is true 1`] = ` +exports[`KeepLink should should keep fields, but remove directives if shouldKeep is true 1`] = ` "query someQuery { test { some