Skip to content

Commit c013ebb

Browse files
amarflybotnodkz
andauthored
fix: change for Supporting Docs for Apollo Federation (#89)
* Change for Supporting Docs for Apollo Federation * Fixing Tests fixes * test: fix snapshots (run `yarn watch` then press U) * chore: update dependencies * ci: fix errors Co-authored-by: Pablo Damnhorns <[email protected]>
1 parent 9898d79 commit c013ebb

File tree

12 files changed

+4017
-3885
lines changed

12 files changed

+4017
-3885
lines changed

.flowconfig

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@
4343
[options]
4444
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
4545
esproposal.class_instance_fields=enable
46+
esproposal.optional_chaining=enable

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ cache:
99
notifications:
1010
email: true
1111
node_js:
12+
- "12"
1213
- "10"
13-
- "8"
1414
before_install:
1515
- curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.deb && sudo dpkg -i --force-confnew elasticsearch-5.2.2.deb && sudo service elasticsearch restart
1616
before_script:

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"eslint.validate": ["javascript"],
33
"javascript.validate.enable": false,
44
"javascript.autoClosingTags": false,
5-
"eslint.autoFixOnSave": true
5+
"eslint.autoFixOnSave": true,
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.eslint": true
8+
}
69
}

package.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,36 @@
3131
"graphql-compose": "^7.0.4"
3232
},
3333
"devDependencies": {
34-
"@babel/cli": "^7.6.4",
35-
"@babel/core": "^7.6.4",
36-
"@babel/node": "^7.6.3",
37-
"@babel/plugin-proposal-class-properties": "^7.5.5",
38-
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
39-
"@babel/plugin-transform-flow-strip-types": "^7.6.3",
40-
"@babel/plugin-transform-runtime": "^7.6.2",
41-
"@babel/preset-env": "^7.6.3",
42-
"@babel/preset-flow": "^7.0.0",
43-
"aws-sdk": "^2.561.0",
34+
"@babel/cli": "7.8.4",
35+
"@babel/core": "7.8.4",
36+
"@babel/node": "7.8.4",
37+
"@babel/plugin-proposal-class-properties": "7.8.3",
38+
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
39+
"@babel/plugin-transform-flow-strip-types": "7.8.3",
40+
"@babel/plugin-transform-runtime": "7.8.3",
41+
"@babel/preset-env": "7.8.4",
42+
"@babel/preset-flow": "7.8.3",
43+
"aws-sdk": "2.612.0",
4444
"babel-core": "^7.0.0-bridge.0",
4545
"babel-eslint": "^10.0.3",
46-
"babel-jest": "^24.9.0",
47-
"elasticsearch": "^16.5.0",
48-
"eslint": "^6.6.0",
46+
"babel-jest": "25.1.0",
47+
"elasticsearch": "16.6.0",
48+
"eslint": "6.8.0",
4949
"eslint-config-airbnb-base": "^14.0.0",
50-
"eslint-config-prettier": "^6.5.0",
51-
"eslint-plugin-flowtype": "^4.3.0",
52-
"eslint-plugin-import": "^2.18.2",
53-
"eslint-plugin-prettier": "^3.1.1",
50+
"eslint-config-prettier": "6.10.0",
51+
"eslint-plugin-flowtype": "4.6.0",
52+
"eslint-plugin-import": "2.20.1",
53+
"eslint-plugin-prettier": "3.1.2",
5454
"express": "^4.17.1",
5555
"express-graphql": "^0.9.0",
5656
"flow-bin": "0.110.0",
57-
"graphql": "^14.5.8",
58-
"graphql-compose": "^7.4.2",
59-
"jest": "^24.9.0",
60-
"nodemon": "^1.19.4",
57+
"graphql": "14.6.0",
58+
"graphql-compose": "7.10.0",
59+
"jest": "25.1.0",
60+
"nodemon": "2.0.2",
6161
"npm-run-all": "^4.1.5",
62-
"prettier": "^1.18.2",
63-
"rimraf": "^3.0.0",
62+
"prettier": "1.19.1",
63+
"rimraf": "3.0.1",
6464
"semantic-release": "^15.13.28"
6565
},
6666
"scripts": {

src/elasticDSL/Aggs/__tests__/Aggs-test.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ describe('AGGS args converter', () => {
3838
});
3939

4040
it('convertAggsBlocks()', () => {
41-
expect(convertAggsBlocks([{ key: 'field1', value: {} }, { key: 'field2', value: {} }])).toEqual(
42-
{
43-
field1: {},
44-
field2: {},
45-
}
46-
);
41+
expect(
42+
convertAggsBlocks([
43+
{ key: 'field1', value: {} },
44+
{ key: 'field2', value: {} },
45+
])
46+
).toEqual({
47+
field1: {},
48+
field2: {},
49+
});
4750
});
4851

4952
it('should convert recursively aggs', () => {

src/elasticDSL/Aggs/__tests__/__snapshots__/Aggs-test.js.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ input Elastic_AggsDateHistogram_50 {
183183
offset: String
184184
185185
\\"\\"\\"
186-
Date Format/Patter. Eg \\"MM-yyy\\" returns \\"08-2012\\". [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
186+
Date Format/Patter. Eg MM-yyy returns 08-2012. [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
187187
\\"\\"\\"
188188
format: String
189189
missing: String
@@ -201,7 +201,7 @@ input Elastic_AggsDateRange_50 {
201201
field: String
202202
203203
\\"\\"\\"
204-
Date Format/Patter. Eg \\"MM-yyy\\" returns \\"08-2012\\". [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
204+
Date Format/Patter. Eg MM-yyy returns 08-2012. [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
205205
\\"\\"\\"
206206
format: String
207207
ranges: [Elastic_DateRange_50]
@@ -965,7 +965,7 @@ input Elastic_QueryMatchAll_50 {
965965
}
966966
967967
\\"\\"\\"
968-
The More Like This Query (MLT Query) finds documents that are \\"like\\" a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
968+
The More Like This Query (MLT Query) finds documents that are like a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
969969
\\"\\"\\"
970970
input Elastic_QueryMoreLikeThis_50 {
971971
fields: [String]
@@ -983,7 +983,7 @@ input Elastic_QueryMultiMatch_50 {
983983
query: String!
984984
985985
\\"\\"\\"
986-
Array of fields [ \\"title\\", \\"*_name\\", \\"subject^3\\" ]. You may use wildcards and boosting field.
986+
Array of fields [ title, *_name, subject^3 ]. You may use wildcards and boosting field.
987987
\\"\\"\\"
988988
fields: [String]!
989989
type: Elastic_QueryMultiMatchTypeEnum_50

src/elasticDSL/Commons/Date.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function getDateFormatFC(
2828
type: 'String',
2929
description: desc(
3030
`
31-
Date Format/Patter. Eg "MM-yyy" returns "08-2012".
31+
Date Format/Patter. Eg MM-yyy returns 08-2012.
3232
[JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
3333
`
3434
),

src/elasticDSL/Query/FullText/MultiMatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function getMultiMatchITC<TContext>(
2323
type: '[String]!',
2424
description: desc(
2525
`
26-
Array of fields [ "title", "*_name", "subject^3" ].
26+
Array of fields [ title, *_name, subject^3 ].
2727
You may use wildcards and boosting field.
2828
`
2929
),

src/elasticDSL/Query/Specialized/MoreLikeThis.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function getMoreLikeThisITC<TContext>(
1010
const name = getTypeName('QueryMoreLikeThis', opts);
1111
const description = desc(
1212
`
13-
The More Like This Query (MLT Query) finds documents that are "like" a given set of documents.
13+
The More Like This Query (MLT Query) finds documents that are like a given set of documents.
1414
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
1515
`
1616
);

src/elasticDSL/Query/__tests__/__snapshots__/Query-test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ input Elastic_QueryMatchAll_50 {
277277
}
278278
279279
\\"\\"\\"
280-
The More Like This Query (MLT Query) finds documents that are \\"like\\" a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
280+
The More Like This Query (MLT Query) finds documents that are like a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
281281
\\"\\"\\"
282282
input Elastic_QueryMoreLikeThis_50 {
283283
fields: [String]
@@ -295,7 +295,7 @@ input Elastic_QueryMultiMatch_50 {
295295
query: String!
296296
297297
\\"\\"\\"
298-
Array of fields [ \\"title\\", \\"*_name\\", \\"subject^3\\" ]. You may use wildcards and boosting field.
298+
Array of fields [ title, *_name, subject^3 ]. You may use wildcards and boosting field.
299299
\\"\\"\\"
300300
fields: [String]!
301301
type: Elastic_QueryMultiMatchTypeEnum_50

src/utils.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ export async function fetchElasticMapping(
115115
);
116116
}
117117

118-
const elasticMapping = (await opts.elasticClient.indices.getMapping({
119-
index: opts.elasticIndex,
120-
type: opts.elasticType,
121-
}))[opts.elasticIndex].mappings[opts.elasticType];
118+
const elasticMapping = (
119+
await opts.elasticClient.indices.getMapping({
120+
index: opts.elasticIndex,
121+
type: opts.elasticType,
122+
})
123+
)[opts.elasticIndex].mappings[opts.elasticType];
122124

123125
return elasticMapping;
124126
}

0 commit comments

Comments
 (0)