Reputation: 1621
GraphQl returns 200 even in case of error but with errors object in response. I want to set it to 400. Assume I need to integrate it into createHandler?
import { createHandler } from "graphql-http/lib/use/express";
import mySchema from "./.mySchema";
const StringArrayScalar = new GraphQLScalarType({......
var root = {
query1({ id }) {
return xxx
},
query2({ id }) {
return xxx
},
};
const handler = createHandler({
schema: mySchema,
rootValue: root,
pretty: true,
graphiql: true,
resolver: {
StringArray: StringArrayScalar,
}
});
export default handler;
Upvotes: 0
Views: 127