-
Notifications
You must be signed in to change notification settings - Fork 97
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
Security annotation use results in array_combine() error #339
Comments
Please provide a stack-trace. |
Not sure how to get a decent track trace because it's formatted to a JSON result by the Graphql middleware. With some var_dumping and die() I got this. Hope it's enough. I have added it to the initial question/comment. |
@sanderlissenburg without digging into this bit of the code further, I'm not entirely certain here. Can you verify that you have an active User session/object available? We don't use this User "session management stuff" with GraphQLite, as I've stated my opinion on this before, I'm not a fan of this library getting tangled up in the User logic of an application. I, personally, would never advise it's use. IMO, all of your User logic should be managed outside of this library. The |
final class Foo
{
/**
* @Field
* @Security("this.foo()")
* @param FooModel $fooModel
* @return string
*/
public function name(FooModel $fooModel): string
{
return $fooModel->bar;
}
public function foo(): bool
{
return false;
}
} |
Same problem vendor/thecodingmachine/graphqlite/src/Middlewares/SecurityFieldMiddleware.php:132. Here array $parameters is empty, becouse of array_shift at vendor/thecodingmachine/graphqlite/src/FieldsBuilder.php:378, when injectSource class |
@vyaaki be great if you could submit a PR with tests. |
I'm trying to use a custom method for the security test as documented under "Accessing the current object".
https://graphqlite.thecodingmachine.io/docs/fine-grained-security#accessing-the-current-object
But this results in the following error.
For example.
I'm using version 4.1.2.
The text was updated successfully, but these errors were encountered: