Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-11737] [PoC] custom Tyk directive @uppercase #428

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

buraksezer
Copy link

@buraksezer buraksezer commented Apr 12, 2024

Proof of concept for TT-11737.

  • A custom directive has been added named toUpper.
  • CustomDirective interface 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.go and pkg/engine/resolve/resolve.go files.
  • 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. TykTechnologies/tyk#6225

Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant