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
This commit is contained in:
Antonio Davi Macedo Coelho de Castro
2019-12-01 21:43:08 -08:00
committed by GitHub
parent 67e3c33ffe
commit a9066e20dc
22 changed files with 4685 additions and 2816 deletions

View File

@@ -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,
@@ -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();
});
@@ -217,7 +226,15 @@ 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' } },
@@ -225,7 +242,10 @@ describe('parseObjectToMongoObjectForCreate', () => {
expect(typeof output.location).toEqual('object');
expect(output.location).toEqual({
__type: 'Polygon',
coordinates: [[lng, lat], [lng, lat]],
coordinates: [
[lng, lat],
[lng, lat],
],
});
done();
});