Layer7-Community / graphman-client

This repository contains a Postman collection, a Node.js CLI application, sample queries for the CLI, and GraphQL schemas for the Graphman API.
Other
7 stars 5 forks source link

pre-request extension parameters #68

Open muemi03 opened 2 months ago

muemi03 commented 2 months ago

May I ask for getting additional arguments for the pre-request extension. I am especially interested in the options. That way we would be able to influence the request based on specified options. Thanks and kind regards ...Michael

graju256 commented 2 months ago

@muemi03 I've lately realized about the same. I'm already working on to provide enough context in building the logic for extensions.

As of now, I'm going to add one extra argument to every extension i.e., context. This will be populated with extra details going forward.

apply: function(input, context): expected to return single output object

graju256 commented 2 months ago

FYI: https://github.com/Layer7-Community/graphman-client/pull/67/commits/3ae347d1000701cd6192790aabc17199149570c1

muemi03 commented 2 months ago

@graju256 Great. So this ask seem to be already answered? Taking a look at the changes, I recognized that the graphman.invoke isn't called with context and so, the pre-request extension would not get any context. call hierarchy as far as I can see: graphman-operation-export.js : export calls graphman.invoke (without context) (line graphman.js : invoke calls pre-request extension with empty context always

That still leads to no context in the pre-request extension :(

Hope this is understandable.

graju256 commented 2 months ago

@muemi03 As of now, context is not well-defined. We will populate it as time progresses. Please consider it as experimental, requires some time to stabilize it.