graphql-go-tools
graphql-go-tools copied to clipboard
[TT-11737] [PoC] custom Tyk directive @uppercase
Proof of concept for TT-11737.
- A custom directive has been added named
toUpper. CustomDirectiveinterface has been added. Any struct that implements this interface can be used as a directive.- This PoC only works for the proxy-only method. It's easy to extend it.
- The actual implementation lives in
pkg/engine/plan/plan.goandpkg/engine/resolve/resolve.gofiles. - The GraphQL data source takes a map of custom directives, it doesn't push the custom directives to the upstream.
- The resolver executes the directive's business logic.
Passing the custom directives to the inner layers of the library required some attention but the implementation itself is not too complicated. The directive implementation lives in Tyk GW and it's passed to the library via graphql.NewProxyEngineConfigFactory after initialization.
The PoC PR on the Tyk side. https://github.com/TykTechnologies/tyk/pull/6225
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code