-
Notifications
You must be signed in to change notification settings - Fork 529
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
Providing functions to meta no longer works #928
Comments
any news about this? |
Hi, I am wondering if the work @Hermanverschooten did to fix meta on fields would not actually fix this issue as well. Can you try to reproduce on master ? Thanks. |
@tlvenn do functions work if you use the persistent term backend? |
@tlvenn I tried it again with the master version and still getting the same error, both when using the shortcut syntax and the I'm still not sure if this is how it's supposed to work, but I fixed my problem by evaluating the AST at runtime before trying to execute the function: jungsoft/rajska@01f716a. @benwilson512 Should we evaluate the AST inside Absinthe or is it expected that the library clients do that on their own, like I did in that commit? |
Duplicate issue that was already closed for this: #737 I still think it's a valuable property to keep, but apparently the complexity wasn't worth it, from @benwilson512 . |
Hey folks. I believe as we prep to switch to using |
This can be accomplished in 1.5 using In your case, you can set the meta: {:meta, dynamic_meta()} Documented here: https://hexdocs.pm/absinthe/Absinthe.Schema.html#c:hydrate/2 |
Environment
Expected behavior
I expected the following to work (works in 1.4.16):
When inspecting the
meta[:private]
field in 1.4.16, in a middleware:I get the function:
#Function<5.7636899/1 in Rajska.FieldAuthorizationTest.Schema.__absinthe_type__/1>
Actual behavior
In 1.5.1, however, with the same code I'm getting the AST instead of the function:
Was this change intentional? By providing the AST instead of the actual value, it's now hard to use more complex structures in the
meta
, such as functions and maps, which is something some libraries depend upon.The text was updated successfully, but these errors were encountered: