Skip to content

Commit

Permalink
Relay Spec (#6089)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
davimacedo authored Dec 2, 2019
1 parent 67e3c33 commit a9066e2
Show file tree
Hide file tree
Showing 22 changed files with 5,214 additions and 3,345 deletions.
1,821 changes: 483 additions & 1,338 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"follow-redirects": "1.9.0",
"graphql": "14.5.8",
"graphql-list-fields": "2.0.2",
"graphql-relay": "^0.6.0",
"graphql-tools": "^4.0.5",
"graphql-upload": "8.1.0",
"intersect": "1.0.1",
Expand Down
10 changes: 8 additions & 2 deletions spec/AuthenticationAdapters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ describe('AuthenticationProviders', function() {
Promise.prototype.constructor
);
jequal(validateAppIdPromise.constructor, Promise.prototype.constructor);
validateAuthDataPromise.then(() => {}, () => {});
validateAppIdPromise.then(() => {}, () => {});
validateAuthDataPromise.then(
() => {},
() => {}
);
validateAppIdPromise.then(
() => {},
() => {}
);
done();
});

Expand Down
28 changes: 24 additions & 4 deletions spec/MongoTransform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ describe('parseObjectToMongoObjectForCreate', () => {
const lng3 = 65;
const polygon = {
__type: 'Polygon',
coordinates: [[lat1, lng1], [lat2, lng2], [lat3, lng3]],
coordinates: [
[lat1, lng1],
[lat2, lng2],
[lat3, lng3],
],
};
const out = transform.parseObjectToMongoObjectForCreate(
null,
Expand All @@ -107,7 +111,12 @@ describe('parseObjectToMongoObjectForCreate', () => {
}
);
expect(out.location.coordinates).toEqual([
[[lng1, lat1], [lng2, lat2], [lng3, lat3], [lng1, lat1]],
[
[lng1, lat1],
[lng2, lat2],
[lng3, lat3],
[lng1, lat1],
],
]);
done();
});
Expand Down Expand Up @@ -217,15 +226,26 @@ describe('parseObjectToMongoObjectForCreate', () => {
const lng = 45;
// Mongo stores polygon in WGS84 lng/lat
const input = {
location: { type: 'Polygon', coordinates: [[[lat, lng], [lat, lng]]] },
location: {
type: 'Polygon',
coordinates: [
[
[lat, lng],
[lat, lng],
],
],
},
};
const output = transform.mongoObjectToParseObject(null, input, {
fields: { location: { type: 'Polygon' } },
});
expect(typeof output.location).toEqual('object');
expect(output.location).toEqual({
__type: 'Polygon',
coordinates: [[lng, lat], [lng, lat]],
coordinates: [
[lng, lat],
[lng, lat],
],
});
done();
});
Expand Down
Loading

0 comments on commit a9066e2

Please sign in to comment.