Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed May 22, 2023
1 parent 19a7da9 commit 49d0a96
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
33 changes: 12 additions & 21 deletions packages/loaders/json-schema/src/getComposerFromJSONSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,31 +687,22 @@ export function getComposerFromJSONSchema(
...subSchema,
};
case 'Query':
if (path === '/properties/query') {
return {
output: schemaComposer.Query,
...subSchema,
};
}
subSchema.title += '_';
return {
output: schemaComposer.Query,
...subSchema,
};
break;
case 'Mutation':
if (path === '/properties/mutation') {
return {
output: schemaComposer.Mutation,
...subSchema,
};
}
subSchema.title += '_';
return {
output: schemaComposer.Mutation,
...subSchema,
};
break;
case 'Subscription':
if (path === '/properties/subscription') {
return {
output: schemaComposer.Subscription,
...subSchema,
};
}
subSchema.title += '_';
return {
output: schemaComposer.Subscription,
...subSchema,
};
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ type Mutation {
expect(output instanceof ObjectTypeComposer).toBeTruthy();
expect((output as SchemaComposer).toSDL()).toContain(
/* GraphQL */ `
type Subscription_ {
type Subscription {
foo: String
}
`.trim(),
Expand Down
2 changes: 1 addition & 1 deletion packages/loaders/json-schema/test/timeout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ describe('Timeout', () => {
}
`),
});
expect(result?.errors?.[0]?.message).toContain('timeout in 300 ms');
expect(result?.errors?.[0]?.message).toContain('The operation was aborted');
});
});

0 comments on commit 49d0a96

Please sign in to comment.