Skip to content

Commit a9066e2

Browse files
authored
Relay Spec (#6089)
* Install graphql-relay * Add relayNodeInterface to ParseGraphQLSchema * Add support to global id * Add support to global id in other operations * Fix sort by glboal id * Fix where by global id * Introduce IdWhereInput * Add Relay object identification tests * Client mutation id on createFile mutation * Client mutation id on callCloudCode mutation * Client mutation id on signUp mutation * Client mutation id on logIn mutation * Client mutation id on logOut mutation * Client mutation id on createClass mutation * Client mutation id on updateClass mutation * Client mutation id on deleteClass mutation * Client mutation id on create object mutation * Improve Viewer type * Client mutation id on update object mutation * Client mutation id on delete object mutation * Introducing connections * Fix tests * Add pagination test * Fix file location * Fix postgres tests * Add comments * Tests to calculateSkipAndLimit
1 parent 67e3c33 commit a9066e2

22 files changed

+5214
-3345
lines changed

package-lock.json

+483-1,338
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"follow-redirects": "1.9.0",
3535
"graphql": "14.5.8",
3636
"graphql-list-fields": "2.0.2",
37+
"graphql-relay": "^0.6.0",
3738
"graphql-tools": "^4.0.5",
3839
"graphql-upload": "8.1.0",
3940
"intersect": "1.0.1",

spec/AuthenticationAdapters.spec.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ describe('AuthenticationProviders', function() {
5454
Promise.prototype.constructor
5555
);
5656
jequal(validateAppIdPromise.constructor, Promise.prototype.constructor);
57-
validateAuthDataPromise.then(() => {}, () => {});
58-
validateAppIdPromise.then(() => {}, () => {});
57+
validateAuthDataPromise.then(
58+
() => {},
59+
() => {}
60+
);
61+
validateAppIdPromise.then(
62+
() => {},
63+
() => {}
64+
);
5965
done();
6066
});
6167

spec/MongoTransform.spec.js

+24-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ describe('parseObjectToMongoObjectForCreate', () => {
9797
const lng3 = 65;
9898
const polygon = {
9999
__type: 'Polygon',
100-
coordinates: [[lat1, lng1], [lat2, lng2], [lat3, lng3]],
100+
coordinates: [
101+
[lat1, lng1],
102+
[lat2, lng2],
103+
[lat3, lng3],
104+
],
101105
};
102106
const out = transform.parseObjectToMongoObjectForCreate(
103107
null,
@@ -107,7 +111,12 @@ describe('parseObjectToMongoObjectForCreate', () => {
107111
}
108112
);
109113
expect(out.location.coordinates).toEqual([
110-
[[lng1, lat1], [lng2, lat2], [lng3, lat3], [lng1, lat1]],
114+
[
115+
[lng1, lat1],
116+
[lng2, lat2],
117+
[lng3, lat3],
118+
[lng1, lat1],
119+
],
111120
]);
112121
done();
113122
});
@@ -217,15 +226,26 @@ describe('parseObjectToMongoObjectForCreate', () => {
217226
const lng = 45;
218227
// Mongo stores polygon in WGS84 lng/lat
219228
const input = {
220-
location: { type: 'Polygon', coordinates: [[[lat, lng], [lat, lng]]] },
229+
location: {
230+
type: 'Polygon',
231+
coordinates: [
232+
[
233+
[lat, lng],
234+
[lat, lng],
235+
],
236+
],
237+
},
221238
};
222239
const output = transform.mongoObjectToParseObject(null, input, {
223240
fields: { location: { type: 'Polygon' } },
224241
});
225242
expect(typeof output.location).toEqual('object');
226243
expect(output.location).toEqual({
227244
__type: 'Polygon',
228-
coordinates: [[lng, lat], [lng, lat]],
245+
coordinates: [
246+
[lng, lat],
247+
[lng, lat],
248+
],
229249
});
230250
done();
231251
});

0 commit comments

Comments
 (0)