errors()
Returns one, or multiple GraphQL errors in the mocked response.
Call signature
1function errors(errorsList: GraphQLError[]): MockedResponse
Examples
1graphql.mutation('Login', (req, res, ctx) => {2 return res(3 ctx.errors([4 {5 message: 'Failed to log in: username or password are invalid',6 locations: [7 {8 line: 8,9 column: 12,10 },11 ],12 },13 ]),14 )15})