GraphQL schema operations (#5993)

* Remove nested operations

* Improve error log

* Fix bug schema to load

* Fix ParseGraphQLSchema tests

* Fix tests

* Fix failing tests

* First verstion not complete of create class mutation

* Fix bug caused by circular dependency

* Renaming files

* Schema types should be loaded before parse classes

* Fix tests

* Create class mutation boilerplate

* Improve CreateClassSchemaInput fields names

* Remove fields

* Pointer and relation fields

* Improve pointer default type

* Class type

* Create class mutation resolver

* Schema field transformers

* Class types transformations

* First test

* Numbers test

* Boolean tests

* Date test

* Fix some get tests

* Test for created at and updated at

* File tests

* Test for objects

* Renaming reducerFabric to reducerGenerator

* Changing get tests for file and object

* Object composed queries test

* Array test

* Null field test

* Bytes test

* Geo Point test

* Polygons tests

* Remove create generic mutation

* Fix tests

* Create class test - isRequired and defaultValue will be added back later

* Enforce master key

* Fix tests

* Duplicated field test

* updateClass mutation

* Remove update generic mutation tests

* Remove update generic mutation

* deleteClass mutation

* Remove delete generic mutation tests

* Remove delete generic mutation

* class query

* Classes query

* Remove get generic query from tests

* Remove remaining generic operations and fix tests

* Fix last test

* Try to fix redis tests

* Fix postgres tests

* Update objectsMutations and objectsQueries files locations

* Rename classSchema files to schema files

* Rename ClassObject to ParseObject

* Fix names and paths

* Still some wrong names
This commit is contained in:
Antonio Davi Macedo Coelho de Castro
2019-09-01 22:11:03 -07:00
committed by GitHub
parent e404c43222
commit 5a482bd661
24 changed files with 3604 additions and 2147 deletions

View File

@@ -270,13 +270,13 @@ describe('ParseGraphQLSchema', () => {
warn: message => {
logged = true;
expect(message).toEqual(
'Query get could not be added to the auto schema because it collided with an existing field.'
'Query viewer could not be added to the auto schema because it collided with an existing field.'
);
},
},
});
await parseGraphQLSchema.load();
expect(parseGraphQLSchema.addGraphQLQuery('get', {})).toBeUndefined();
expect(parseGraphQLSchema.addGraphQLQuery('viewer', {})).toBeUndefined();
expect(logged).toBeTruthy();
});
@@ -291,12 +291,12 @@ describe('ParseGraphQLSchema', () => {
},
});
await parseGraphQLSchema.load();
delete parseGraphQLSchema.graphQLQueries.get;
delete parseGraphQLSchema.graphQLQueries.viewer;
const field = {};
expect(parseGraphQLSchema.addGraphQLQuery('get', field, true, true)).toBe(
field
);
expect(parseGraphQLSchema.graphQLQueries['get']).toBe(field);
expect(
parseGraphQLSchema.addGraphQLQuery('viewer', field, true, true)
).toBe(field);
expect(parseGraphQLSchema.graphQLQueries['viewer']).toBe(field);
});
});
@@ -363,14 +363,14 @@ describe('ParseGraphQLSchema', () => {
warn: message => {
logged = true;
expect(message).toEqual(
'Mutation create could not be added to the auto schema because it collided with an existing field.'
'Mutation signUp could not be added to the auto schema because it collided with an existing field.'
);
},
},
});
await parseGraphQLSchema.load();
expect(
parseGraphQLSchema.addGraphQLMutation('create', {})
parseGraphQLSchema.addGraphQLMutation('signUp', {})
).toBeUndefined();
expect(logged).toBeTruthy();
});
@@ -386,12 +386,12 @@ describe('ParseGraphQLSchema', () => {
},
});
await parseGraphQLSchema.load();
delete parseGraphQLSchema.graphQLMutations.create;
delete parseGraphQLSchema.graphQLMutations.signUp;
const field = {};
expect(
parseGraphQLSchema.addGraphQLMutation('create', field, true, true)
parseGraphQLSchema.addGraphQLMutation('signUp', field, true, true)
).toBe(field);
expect(parseGraphQLSchema.graphQLMutations['create']).toBe(field);
expect(parseGraphQLSchema.graphQLMutations['signUp']).toBe(field);
});
});