Skip to content

Commit

Permalink
fix: support serverless >= 4.0.23 (sid88in#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
timo92 committed Jul 18, 2024
1 parent e99c51a commit be5f6cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/resources/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CfnResources } from '../types/cloudFormation';
import { Api } from './Api';
import { flatten } from 'lodash';
import { parse, print } from 'graphql';
import ServerlessError from 'serverless/lib/serverless-error';
import { validateSDL } from 'graphql/validation/validate';
import { mergeTypeDefs } from '@graphql-tools/merge';

Expand Down Expand Up @@ -50,7 +49,7 @@ export class Schema {
valdiateSchema(schema: string) {
const errors = validateSDL(parse(schema));
if (errors.length > 0) {
throw new ServerlessError(
throw new this.api.plugin.serverless.classes.Error(
'Invalid GraphQL schema:\n' +
errors.map((error) => ` ${error.message}`).join('\n'),
);
Expand Down

0 comments on commit be5f6cd

Please sign in to comment.