MCPcopy Create free account
hub / github.com/parse-community/parse-server / createObject

Function createObject

spec/ParseGraphQLServer.spec.js:6352–6375  ·  view source on GitHub ↗
(className, headers)

Source from the content-addressed store, hash-verified

6350 await parseGraphQLServer.parseGraphQLSchema.schemaCache.clear();
6351
6352 async function createObject(className, headers) {
6353 const getClassName = className.charAt(0).toLowerCase() + className.slice(1);
6354 const result = await apolloClient.mutate({
6355 mutation: gql`
6356 mutation CreateSomeObject {
6357 create${className}(input: {}) {
6358 ${getClassName} {
6359 id
6360 createdAt
6361 }
6362 }
6363 }
6364 `,
6365 context: {
6366 headers,
6367 },
6368 });
6369
6370 const specificCreate = result.data[`create${className}`][getClassName];
6371 expect(specificCreate.id).toBeDefined();
6372 expect(specificCreate.createdAt).toBeDefined();
6373
6374 return result;
6375 }
6376
6377 await expectAsync(createObject('GraphQLClass')).toBeRejectedWith(
6378 jasmine.stringMatching('Permission denied')

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…