From dd77d35b0a9169f02f8e9f96a6f3a32261ff9f5d Mon Sep 17 00:00:00 2001 From: Jacob Thomason Date: Tue, 10 Oct 2023 13:01:55 -0400 Subject: [PATCH] Updates to package.json for module resolution --- README.md | 4 ++-- lib/index.js | 8 ++------ package.json | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 62cb8a8..8b45afe 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ addUserMutation.operation.sample.whateverField = 'Whatever'; module.exports = addUserMutation; ``` -To assist with customizing extension modules, we provide some utility functions that can be imported from `zapier-graphql/utils`: +To assist with customizing extension modules, we provide some utility functions that can be imported from `zapier-graphql/lib/utils`: - `addDynamicDropdowns(inputFields, triggerMapping)` - `inputFields` - An array of input field objects from the GraphQL operation module @@ -135,7 +135,7 @@ To assist with customizing extension modules, we provide some utility functions ```js Example const addUserMutation = require('../graphql/mutation/add-user'); - const { addDynamicDropdowns } = require('zapier-graphql/utils'); + const { addDynamicDropdowns } = require('zapier-graphql/lib/utils'); addUserMutation.operation.inputFields = addDynamicDropdowns(addUserMutation.operation.inputFields, { country: 'countries.key.name', diff --git a/lib/index.js b/lib/index.js index 9cc5da4..32c0f3d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -745,9 +745,7 @@ const createQueryFile = async (query) => { 'use strict'; -require('dotenv').config(); - -const { quote } = require('zapier-graphql/utils'); +const { quote } = require('zapier-graphql/lib/utils'); // Executes the ${query} query at runtime const perform = async (z, bundle) => { @@ -856,9 +854,7 @@ const createMutationFile = async (mutation) => { 'use strict'; -require('dotenv').config(); - -const { quote } = require('zapier-graphql/utils'); +const { quote } = require('zapier-graphql/lib/utils'); // Executes the ${mutation} mutation at runtime const perform = async (z, bundle) => { diff --git a/package.json b/package.json index 65c1b7d..df33212 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.2", "description": "A GraphQL library that work's with Zapier CLI platform.", "type": "commonjs", - "main": "./lib/index.js", + "main": "index.js", "engines": { "node": ">=18.3.0" },