Closed Nepoxx closed 2 months ago
Hey @Nepoxx,
Definition is something else, I think it refers to https://www.apollographql.com/docs/react/data/document-transforms/#document-caching
Let me know, but this is rather Apollo related.
Well I'm wondering if the callback should be augmented with the definition because it's not clear how to associate n
with the operation in multi-query requests.
I'm coming from this library: https://www.npmjs.com/package/graphql-depth-limit its callback has an association between operations and depth https://www.npmjs.com/package/graphql-depth-limit?activeTab=code
So with my example above, my callback would be called with the following object:
{
"A": 7,
"B": 3
}
I guess this boils down to asking how I can associate n
in the callbacks using graphql-armor
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
This is most likely not a bug and stems from my lack of understanding of how
ValidationContext
works, but if I have the following query:My goal is to log the following when I receive it:
I tried the following:
This prints:
I can see that Query B is found in
definitions[1]
, but I don't know how to associaten
to the correct operation. Would it make sense to passoperation
to handlers here? https://github.com/Escape-Technologies/graphql-armor/blob/a54c8dda401cfa5a46e563d3adbd7e665d3f4edf/packages/plugins/max-depth/src/index.ts#L49Cheers