New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

graphql-makers

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-makers

Functions to make GraphQL types based on schema-language definitions

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

GraphQL Makers

Functions to make GraphQL types based on schema-language definitions.

npm version

WARNING: This is a work-in-progress. It has been briefly tested but only on a recent version of Node/GraphQL.js and for limited use cases.

Examples

Create a GraphQLObjectType object

const { objectType } = require('graphql-makers');

const dependencies = {
  Comment: require.resolve('./comment'),
};

const typeDef = `
  type Post {
    id: ID
    title: String
    content: String
    user: User
    comments: [Comment]
  }
`;

const resolvers = {
  user(parent, args, contex) {
    // ...
  },
  comments(parent, args, context) {
    // ...
  },
};

module.exports = objectType({ typeDef, resolvers, dependencies });

Create a GraphQLSchema object

const typeDef = `
  type Query {
    list: [Int!]!
  }
`;

const resolvers = {
  Query: {
    list: () => [1, 2, 3],
  },
};

module.exports = schemaType({ typeDef, resolvers, dependencies });

License

GraphQL Makers is MIT licensed.

FAQs

Package last updated on 30 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts