Socket
Socket
Sign inDemoInstall

graphql-compose-json

Package Overview
Dependencies
4
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.1.0

6

lib/ObjectParser.d.ts

@@ -1,2 +0,2 @@

import { ObjectTypeComposer, ObjectTypeComposerFieldConfigDefinition } from 'graphql-compose';
import { ObjectTypeComposer, ObjectTypeComposerFieldConfigDefinition, SchemaComposer } from 'graphql-compose';
declare type GetValueOpts = {

@@ -7,3 +7,5 @@ typeName?: string;

export default class ObjectParser {
static createTC(name: string, json: Record<string, any>): ObjectTypeComposer<any, any>;
static createTC(name: string, json: Record<string, any>, opts?: {
schemaComposer: SchemaComposer<any>;
}): ObjectTypeComposer<any, any>;
static getFieldConfig(value: any, opts?: GetValueOpts | null): ObjectTypeComposerFieldConfigDefinition<any, any>;

@@ -10,0 +12,0 @@ }

@@ -14,3 +14,3 @@ "use strict";

}
ObjectParser.createTC = function (name, json) {
ObjectParser.createTC = function (name, json, opts) {
var _this = this;

@@ -20,3 +20,4 @@ if (!json || typeof json !== 'object') {

}
var tc = graphql_compose_1.ObjectTypeComposer.createTemp(name);
var sc = (opts === null || opts === void 0 ? void 0 : opts.schemaComposer) || graphql_compose_1.schemaComposer;
var tc = sc.createObjectTC(name);
Object.keys(json).forEach(function (fieldName) {

@@ -23,0 +24,0 @@ var fieldConfig = _this.getFieldConfig(json[fieldName], { typeName: name, fieldName: fieldName });

{
"name": "graphql-compose-json",
"version": "5.0.0",
"version": "5.1.0",
"description": "This is a plugin for `graphql-compose`, which generates GraphQLTypes from any JSON.",

@@ -5,0 +5,0 @@ "files": [

@@ -139,4 +139,7 @@ # graphql-compose-json

```js
import { schemaComposer } from 'graphql-compose';
import { SchemaComposer } from 'graphql-compose';
const schemaComposer = new SchemaComposer();
const PersonTC = composeWithJson('CustomPerson', restApiResponse, { schemaComposer });
schemaComposer.Query.addFields({

@@ -143,0 +146,0 @@ person: {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc