Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
with:
access: "public"
token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
tag: "beta"
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/plugin-hooks",
"version": "0.1.1",
"version": "0.2.0-beta",
"publishConfig": {
"access": "public"
},
Expand All @@ -21,11 +21,13 @@
"@envelop/core": "^3.0.4",
"eslint": "^8.31.0",
"graphql": "^16.6.0",
"jest": "^29.6.4"
"jest": "^29.6.4",
"newrelic": "11.0.0"
},
"peerDependencies": {
"@envelop/core": "*",
"graphql": "*"
"graphql": "*",
"newrelic": "11.0.0"
},
"repository": {
"type": "git",
Expand Down
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
const newrelic = require("newrelic");
const handleBeforeAllHooks = require("./handleBeforeAllHooks");

async function hooksPlugin(config) {
Expand All @@ -33,6 +34,9 @@ async function hooksPlugin(config) {

return {
async onExecute({ args, setResultAndStopExecution, extendContext }) {
await newrelic.startSegment('handleBeforeAllHooks:onExecute', true, async() => {


const query = args.contextValue.params.query;

const { document, contextValue: context } = args;
Expand Down Expand Up @@ -90,7 +94,9 @@ async function hooksPlugin(config) {
*/

return {};
},
});

},
};
} catch (err) {
console.error('Error while initializing "hooks" plugin', err);
Expand Down
Loading