-
Notifications
You must be signed in to change notification settings - Fork 20
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
directive support #520
Comments
I just implemented it internally, but this would be a nice addition, graphql is a query language so does jsonnet, I think it's pretty valid to extends it with directives, which operates on the selected nodes, and the default behavior is identity function. I took this from graphql , jaywalking Jason path have a pathfunction which let you do this too. And it has a update and set method. |
I'm quite familiar with both of these. These languages can query, but they can also do a lot more, including mutation. JSON Path is only a query language. It does not mutate. It's read-only. |
It's not read only, I implement one and still use it at work, directive can modify the node , as @uppercase |
You misunderstand. JSON Path, per the original idea and the specification, is definitely read-only. Any behavior that you might add to your implementation is extension behavior and not compliant with the spec. As such it should be disabled by default. |
Yes and no, with the directive, the implementation can achieve me and still fulfill the spec. |
Part of implementing the specification is failing when it's supposed to. If you support extra syntax, it won't fail. |
If jsonpath support directive/function and |
Ideally something like This concept is similar to #514 in that it adds a new operating mechanic, and you're welcome to read the reception that idea had. |
Backgroud:
I need to do some translation of a dedicated
string
field from Chinese to other languages, but some fields live inside a internal json object string( a json object, but a jsonString type`.With the current java jsonpath:
I more like to do this in a one run. eg:
Just like the GraphQL's
directives
https://www.apollographql.com/docs/apollo-server/schema/directives/#custom-directivesThe text was updated successfully, but these errors were encountered: