Skip to content

Commit 5a482bd

Browse files
authored
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
1 parent e404c43 commit 5a482bd

24 files changed

+3616
-2159
lines changed

spec/ParseGraphQLSchema.spec.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,13 @@ describe('ParseGraphQLSchema', () => {
270270
warn: message => {
271271
logged = true;
272272
expect(message).toEqual(
273-
'Query get could not be added to the auto schema because it collided with an existing field.'
273+
'Query viewer could not be added to the auto schema because it collided with an existing field.'
274274
);
275275
},
276276
},
277277
});
278278
await parseGraphQLSchema.load();
279-
expect(parseGraphQLSchema.addGraphQLQuery('get', {})).toBeUndefined();
279+
expect(parseGraphQLSchema.addGraphQLQuery('viewer', {})).toBeUndefined();
280280
expect(logged).toBeTruthy();
281281
});
282282

@@ -291,12 +291,12 @@ describe('ParseGraphQLSchema', () => {
291291
},
292292
});
293293
await parseGraphQLSchema.load();
294-
delete parseGraphQLSchema.graphQLQueries.get;
294+
delete parseGraphQLSchema.graphQLQueries.viewer;
295295
const field = {};
296-
expect(parseGraphQLSchema.addGraphQLQuery('get', field, true, true)).toBe(
297-
field
298-
);
299-
expect(parseGraphQLSchema.graphQLQueries['get']).toBe(field);
296+
expect(
297+
parseGraphQLSchema.addGraphQLQuery('viewer', field, true, true)
298+
).toBe(field);
299+
expect(parseGraphQLSchema.graphQLQueries['viewer']).toBe(field);
300300
});
301301
});
302302

@@ -363,14 +363,14 @@ describe('ParseGraphQLSchema', () => {
363363
warn: message => {
364364
logged = true;
365365
expect(message).toEqual(
366-
'Mutation create could not be added to the auto schema because it collided with an existing field.'
366+
'Mutation signUp could not be added to the auto schema because it collided with an existing field.'
367367
);
368368
},
369369
},
370370
});
371371
await parseGraphQLSchema.load();
372372
expect(
373-
parseGraphQLSchema.addGraphQLMutation('create', {})
373+
parseGraphQLSchema.addGraphQLMutation('signUp', {})
374374
).toBeUndefined();
375375
expect(logged).toBeTruthy();
376376
});
@@ -386,12 +386,12 @@ describe('ParseGraphQLSchema', () => {
386386
},
387387
});
388388
await parseGraphQLSchema.load();
389-
delete parseGraphQLSchema.graphQLMutations.create;
389+
delete parseGraphQLSchema.graphQLMutations.signUp;
390390
const field = {};
391391
expect(
392-
parseGraphQLSchema.addGraphQLMutation('create', field, true, true)
392+
parseGraphQLSchema.addGraphQLMutation('signUp', field, true, true)
393393
).toBe(field);
394-
expect(parseGraphQLSchema.graphQLMutations['create']).toBe(field);
394+
expect(parseGraphQLSchema.graphQLMutations['signUp']).toBe(field);
395395
});
396396
});
397397

0 commit comments

Comments
 (0)