New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphql-ready

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-ready - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

37

lib/index.js

@@ -35,19 +35,28 @@

resolver,
}) => ghttp((req, res) => {
const startTime = Date.now()
}) => ghttp(async (req, res) => {
const startTime = Date.now()
return {
schema: buildSchema(schema, resolver),
rootValue: api,
graphiql: true,
formatError: error => ({
message: error.message,
stack: error.stack
}),
extensions: () => ({
took: Date.now() - startTime,
}),
}
const rootValue = typeof api === 'function' ? await api(req) : api
return {
schema: buildSchema(schema, resolver),
rootValue,
graphiql: true,
formatError: error => ({
message: error.message,
stack: error.stack
}),
extensions: ({
result,
}) => {
if (Array.isArray(result.errors) && result.errors.length > 0) {
res.status(400)
}
return {
took: Date.now() - startTime,
}
},
}
})
exports.graphiql = graphiql
{
"name": "graphql-ready",
"version": "3.0.0",
"version": "3.1.0",
"description": "make graphql ready for start",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -16,2 +16,3 @@

type Query {
error: JSON
echo(message: JSON!): JSON

@@ -23,5 +24,8 @@ groups: Groups

const api = {
error () {
throw new Error('error happend')
},
echo ({message}) {
return message
}
},
}

@@ -28,0 +32,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc