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 1.0.0 to 2.0.0

13

lib/index.js

@@ -17,4 +17,10 @@

const buildSchema = (schemaString) => {
return makeExecutableSchema({ typeDefs: schemaString, resolvers: resolveFunctions })
const buildSchema = (typeDefs, resolvers) => {
return makeExecutableSchema({
typeDefs,
resolvers: {
...resolveFunctions,
...resolvers,
},
})
}

@@ -29,2 +35,3 @@

schema,
resolver,
}) => ghttp((req, res) => {

@@ -34,3 +41,3 @@ const startTime = Date.now()

return {
schema: buildSchema(schema),
schema: buildSchema(schema, resolver),
rootValue: api,

@@ -37,0 +44,0 @@ graphiql: true,

{
"name": "graphql-ready",
"version": "1.0.0",
"version": "2.0.0",
"description": "make graphql ready for start",

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

@@ -5,4 +5,15 @@

type Group {
userId: String
userName: String
}
type Groups {
count: Int
data: [Group]
}
type Query {
echo(message: JSON!): JSON
groups: Groups
}

@@ -17,2 +28,16 @@ `

const resolver = {
Query: {
groups () {
console.log('abc')
return {count: 2, data: [{userId: 'userId'}]}
},
},
Group: {
userName (group) {
return `${group.userId}-userName`
}
},
}
const {

@@ -25,3 +50,3 @@ graphiql,

express()
.use(graphiql({schema, api}))
.use(graphiql({schema, api, resolver}))
.listen(process.env.PORT || 3000)
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