Skip to content

Commit bb41090

Browse files
committed
Remove deprecated __alias field support
1 parent 9acad1a commit bb41090

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
# json-to-graphql-query Changelog
33

4+
## 2.0.0
5+
6+
* Update to TypeScript 3.7
7+
* Support for full inline fragments (thanks @ConnorWhite)
8+
* Remove deprecated `__alias` (use `__aliasFor` instead)
9+
410
## 1.9.0
511

612
* Added support for array values. We now use the first object found in an array for the
@@ -37,8 +43,3 @@
3743
## 1.2.0
3844

3945
* Added Enum support, thanks @douglaseggleton
40-
41-
## 2.0.0
42-
43-
* Update to TypeScript 3.7
44-
* Support for full inline fragments (thanks @ConnorWhite)

src/__tests__/aliases.tests.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@ import { jsonToGraphQLQuery } from '../';
44

55
describe('jsonToGraphQLQuery() - aliases', () => {
66

7-
it('uses aliases for fields', () => {
8-
// Deprecated...
9-
const query = {
10-
query: {
11-
Posts: {
12-
__alias: 'lorem',
13-
__args: {
14-
arg1: 20,
15-
},
16-
id: true
17-
}
18-
}
19-
};
20-
expect(jsonToGraphQLQuery(query)).to.equal(
21-
'query { lorem: Posts (arg1: 20) { id } }'
22-
);
23-
});
24-
257
it('supports multiple aliases for one type', () => {
268
const query = {
279
query: {

src/jsonToGraphQLQuery.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ function convertQuery(node: any, level: number, output: [string, number][], opti
127127
token = `${token} ${dirsStr}${spacer}${argsStr}`;
128128
}
129129

130-
// DEPRECATED: Should be removed in version 2.0.0
131-
if (typeof value.__alias === 'string') {
132-
token = `${value.__alias}: ${token}`;
133-
}
134-
135130
output.push([token + (subFields || partialFragmentsExist || fullFragmentsExist ? ' {' : ''), level]);
136131
convertQuery(value, level + 1, output, options);
137132

0 commit comments

Comments
 (0)