Skip to content

Commit 50e294a

Browse files
committed
wip
1 parent 5ffefc5 commit 50e294a

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

spec/ParseGraphQLServer.spec.js

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ describe('ParseGraphQLServer', () => {
8585

8686
it('should initialize parseGraphQLSchema with a log controller', async () => {
8787
const loggerAdapter = {
88-
log: () => {},
89-
error: () => {},
88+
log: () => { },
89+
error: () => { },
9090
};
9191
const parseServer = await global.reconfigureServer({
9292
loggerAdapter,
@@ -441,8 +441,8 @@ describe('ParseGraphQLServer', () => {
441441
},
442442
},
443443
});
444-
spyOn(console, 'warn').and.callFake(() => {});
445-
spyOn(console, 'error').and.callFake(() => {});
444+
spyOn(console, 'warn').and.callFake(() => { });
445+
spyOn(console, 'error').and.callFake(() => { });
446446
});
447447

448448
afterEach(async () => {
@@ -821,7 +821,7 @@ describe('ParseGraphQLServer', () => {
821821
});
822822

823823
it('should have clientMutationId in call function input', async () => {
824-
Parse.Cloud.define('hello', () => {});
824+
Parse.Cloud.define('hello', () => { });
825825

826826
const callFunctionInputFields = (
827827
await apolloClient.query({
@@ -843,7 +843,7 @@ describe('ParseGraphQLServer', () => {
843843
});
844844

845845
it('should have clientMutationId in call function payload', async () => {
846-
Parse.Cloud.define('hello', () => {});
846+
Parse.Cloud.define('hello', () => { });
847847

848848
const callFunctionPayloadFields = (
849849
await apolloClient.query({
@@ -6512,7 +6512,7 @@ describe('ParseGraphQLServer', () => {
65126512
);
65136513
expect(
65146514
(await deleteObject(object4.className, object4.id)).data.delete[
6515-
object4.className.charAt(0).toLowerCase() + object4.className.slice(1)
6515+
object4.className.charAt(0).toLowerCase() + object4.className.slice(1)
65166516
]
65176517
).toEqual({ objectId: object4.id, __typename: 'PublicClass' });
65186518
await expectAsync(object4.fetch({ useMasterKey: true })).toBeRejectedWith(
@@ -7242,9 +7242,9 @@ describe('ParseGraphQLServer', () => {
72427242
it('should send reset password', async () => {
72437243
const clientMutationId = uuidv4();
72447244
const emailAdapter = {
7245-
sendVerificationEmail: () => {},
7245+
sendVerificationEmail: () => { },
72467246
sendPasswordResetEmail: () => Promise.resolve(),
7247-
sendMail: () => {},
7247+
sendMail: () => { },
72487248
};
72497249
parseServer = await global.reconfigureServer({
72507250
appName: 'test',
@@ -7282,11 +7282,11 @@ describe('ParseGraphQLServer', () => {
72827282
const clientMutationId = uuidv4();
72837283
let resetPasswordToken;
72847284
const emailAdapter = {
7285-
sendVerificationEmail: () => {},
7285+
sendVerificationEmail: () => { },
72867286
sendPasswordResetEmail: ({ link }) => {
72877287
resetPasswordToken = link.split('token=')[1].split('&')[0];
72887288
},
7289-
sendMail: () => {},
7289+
sendMail: () => { },
72907290
};
72917291
parseServer = await global.reconfigureServer({
72927292
appName: 'test',
@@ -7351,9 +7351,9 @@ describe('ParseGraphQLServer', () => {
73517351
it('should send verification email again', async () => {
73527352
const clientMutationId = uuidv4();
73537353
const emailAdapter = {
7354-
sendVerificationEmail: () => {},
7354+
sendVerificationEmail: () => { },
73557355
sendPasswordResetEmail: () => Promise.resolve(),
7356-
sendMail: () => {},
7356+
sendMail: () => { },
73577357
};
73587358
parseServer = await global.reconfigureServer({
73597359
appName: 'test',
@@ -9142,8 +9142,6 @@ describe('ParseGraphQLServer', () => {
91429142
contentType: 'text/plain',
91439143
});
91449144

9145-
console.log(body);
9146-
91479145
let res = await fetch('http://localhost:13377/graphql', {
91489146
method: 'POST',
91499147
headers,
@@ -9154,6 +9152,7 @@ describe('ParseGraphQLServer', () => {
91549152

91559153
const result = JSON.parse(await res.text());
91569154

9155+
console.log(result.errors)
91579156
expect(result.data.createFile.fileInfo.name).toEqual(
91589157
jasmine.stringMatching(/_myFileName.txt$/)
91599158
);
@@ -10550,25 +10549,25 @@ describe('ParseGraphQLServer', () => {
1055010549
},
1055110550
});
1055210551
const SomeClassType = new GraphQLObjectType({
10553-
name: 'SomeClass',
10554-
fields: {
10555-
nameUpperCase: {
10556-
type: new GraphQLNonNull(GraphQLString),
10557-
resolve: p => p.name.toUpperCase(),
10558-
},
10559-
type: { type: TypeEnum },
10560-
language: {
10561-
type: new GraphQLEnumType({
10562-
name: 'LanguageEnum',
10563-
values: {
10564-
fr: { value: 'fr' },
10565-
en: { value: 'en' },
10566-
},
10567-
}),
10568-
resolve: () => 'fr',
10569-
},
10552+
name: 'SomeClass',
10553+
fields: {
10554+
nameUpperCase: {
10555+
type: new GraphQLNonNull(GraphQLString),
10556+
resolve: p => p.name.toUpperCase(),
1057010557
},
10571-
}),
10558+
type: { type: TypeEnum },
10559+
language: {
10560+
type: new GraphQLEnumType({
10561+
name: 'LanguageEnum',
10562+
values: {
10563+
fr: { value: 'fr' },
10564+
en: { value: 'en' },
10565+
},
10566+
}),
10567+
resolve: () => 'fr',
10568+
},
10569+
},
10570+
}),
1057210571
parseGraphQLServer = new ParseGraphQLServer(parseServer, {
1057310572
graphQLPath: '/graphql',
1057410573
graphQLCustomTypeDefs: new GraphQLSchema({

src/GraphQL/ParseGraphQLServer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class ParseGraphQLServer {
6868
this.parseServer.config.maxUploadSize || '20mb'
6969
)*/
7070
app.use(this.config.graphQLPath, corsMiddleware());
71-
app.use(this.config.graphQLPath, bodyParser.json());
7271
app.use(this.config.graphQLPath, handleParseHeaders);
7372
app.use(this.config.graphQLPath, handleParseErrors);
7473
app.use(this.config.graphQLPath, async (req, res) => {
@@ -84,7 +83,7 @@ class ParseGraphQLServer {
8483
}
8584
app.get(
8685
this.config.playgroundPath ||
87-
requiredParameter('You must provide a config.playgroundPath to applyPlayground!'),
86+
requiredParameter('You must provide a config.playgroundPath to applyPlayground!'),
8887
(_req, res) => {
8988
res.setHeader('Content-Type', 'text/html');
9089
res.write(

0 commit comments

Comments
 (0)