get-graphql-from-jsonschema
Version:
get-graphql-from-jsonschema gets a GraphQL schema from a JSON schema.
13 lines (12 loc) • 538 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleArrayType = void 0;
const parseSchema_1 = require("./parseSchema");
const handleArrayType = function ({ path, schema, direction }) {
const { typeName: graphqlTypeName, typeDefinitions: graphqlTypeDefinitions } = (0, parseSchema_1.parseSchema)({ path, schema: schema.items, direction });
return {
typeName: `[${graphqlTypeName}]`,
typeDefinitions: graphqlTypeDefinitions
};
};
exports.handleArrayType = handleArrayType;