open-policy-agent / open-policy-agent/java-opa-sdk
Implement GraphQL builtins (graphql.*)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 16
- Forks
- 24
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 15
Description
Missing builtins
graphql.parsegraphql.parse_querygraphql.parse_schemagraphql.parse_and_verifygraphql.is_validgraphql.schema_is_valid
Context
These OPA builtins are not implemented in the SDK. Most are exercised by the Rego compliance suite (opa-evaluator/src/test/resources/compliance/.../TestData) and currently raise FunctionNotFoundError; implementing them makes those cases pass.
Requires a GraphQL parser/schema dependency; likely a new opa-builtins-graphql module.
Implementation notes
Register each builtin with an @OpaBuiltin-annotated static method (see io.github.open_policy_agent.opa.ast.builtin.impls). Core builtins are listed in BuiltinRegistry.BUILTIN_CLASSES; domain-specific ones live in an opa-builtins-* module exposed via the BuiltinProvider SPI (e.g. RegexBuiltins, CidrBuiltins, SemverBuiltins).
Reference: https://www.openpolicyagent.org/docs/policy-reference/#built-in-functions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the GraphQL cases under opa-evaluator/src/test/resources/compliance/.../TestData and inspect BuiltinRegistry.BUILTIN_CLASSES plus the BuiltinProvider SPI. Review the annotated methods in io.github.open_policy_agent.opa.ast.builtin.impls and the existing domain modules such as RegexBuiltins. Done means all six graphql.* functions are registered and the affected compliance cases no longer raise FunctionNotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100