-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Can't get @group directive to work #134
Comments
Try to add also the others, like web, did you removed all middleware in the configuration? |
Yes i stopped all the middlewares in the configurations This is my lighthouse.php:
Edit: |
try to add web, i think JWT needs web to work, i have it like this: 'middleware' => ['web','api'], and in the schemas i add "api:auth" for passport |
Ok, forgive my ignorance here as i'm new to lumen but as far as i understand by adding |
no, pardon me, there is no web on Lumen. |
When i just add api to the list of middlewares in lighthouse.php i get Class api does not exist |
api its the one provided by Laravel Passport, you using jwt. |
Could it be a problem in this specific release? |
Sure, the Beta versions are for testing things out, move to master and let us know if it works, |
But master doesn't have lumen support :'( |
Master should point to https://github.com/nuwave/lighthouse/releases/latest and yes, has the lumen spport. |
I'm pretty sure that when i tried that version of lighthouse it didn't work for me, will double check it right now tho. |
Its only missing couple of functions, but should work out to the box since version v2 |
Hi @EslamNasser, Since my current routing config looks like Oh, and I'm using the Lighthouse |
@4levels Thanks a lot for your response, i just switched to the latest release and i'm getting this error What do you think i should go for here? |
I'm adding a gist right now since there's quite some configuration to share ;-) Hang tight.. |
Won't go anywhere :D |
There youu go ;-) Regarding the authentication: I'm using a Proxy class inside the app/Auth folder that adds the client id and secret to the request and performs the actual login using guzzle over localhost to prevent them from ever being transmitted over the web.. https://gist.github.com/4levels/4c732fbef1b87a3263998136f5bbe61d |
Alright will try this out from my side. |
You're welcome, I've been in the same situation for days now (if not weeks), eagerly awaiting a reply on an issue (as you pbbly already noticed), glad to be able to help. Oh, and I forgot to add any of the graphql schema etc etc, I'll update the gist.. |
Hi @EslamNasser, just so you know, I updated the gist and added some more files, especially the various ServiceProviders were hard to configure.. Hope this gets you going soon! |
@4levels @kikoseijo the Is there a special config i should have for it to work? |
Is it a big project? can you upload? Maybe try on this https://github.com/kikoseijo/lumen-lighthouse-graphql |
@EslamNasser what you stuck at? Been playing with middleware today and you won't get same functionality when added to the route than when inside schema. Anycase, hope you manage to go though and maybe help others with same problem by providing your solution. Happy coding.!" |
@kikoseijo Sorry i got sucked into other things, to answer your 1st question no it's not a big project i just started one to play around with 1st. |
@chrissm79 @EslamNasser , I found the problem. When a query starts like this: Wont work query CuponListQuery(
$first: Int!
$cursor: String
) {
...CuponList_feed
}
fragment CuponList_feed on Query {
cupons(first: $first, after: $cursor) { but if it starts likes this: It works query CuponListQuery {
cupons(first: 10, after: null) { middleware gets called. Problem seems to be on the parse of the query using fragments and will get this type of body when using a Relay We need to work on this. Boss? |
@chrissm79 , deeper debugging got me to find out that the problem its here: On the MiddlewareManager,
recieves:
Somehow we should be able to convert this fragment to its value to retrieve the query. Right now im stuck at trying to pull the real query when I find a
|
@kikoseijo Thanks for digging into this!! Taking a look and hopefully will get something figured out for this one soon! |
@EslamNasser @kikoseijo Okay, just pushed an update that should resolve the issue listed here. Pull down the latest from master and give it a go and let me know if you're still having issues! @EslamNasser Thanks for reporting this!!! |
@chrissm79 cant see the update, ill wait. For now what i did was embed in an upper query and gets called. |
@kikoseijo Sorry about that, just pushed the update to the repo |
@chrissm79 you king! Works for me, @EslamNasser @mits87 I guess your problems are solved after this patch. Thanks a lot, Boss! |
@chrissm79 is it possible to push the fix on dev-master cause this is what i'm using as it has lumen support, please :D |
I believe dev master its the latest commit. little helper for use with envoy tasks: @task('link_lighthouse', ['on' => 'local'])
rm -rf vendor/nuwave/lighthouse
cd vendor/nuwave/
ls -la
ln -s ~/Developer/Laravel/Laravel-Plugins/lighthouse/ ./lighthouse
ls -la
@endtask |
@chrissm79 @kikoseijo I'm still unable to get the |
@EslamNasser many of us are using it and its working. I did found 1 and the cause not long ago and the Boss! did the fix in couple days, so, don´t leave it at the side for long like been. |
Should be resolved through #140. You are now able to add middleware either through Closing this for now, feel free to reopen if the issue persists. |
Lighthouse version: 2.1-beta.5 for lumen support
Hello, i'm using lumen with lighthouse and everything is working perfectly except for the @group directive as i want to apply an auth middleware to a group of queries. Every time i try to execute one of the queries in that group it goes straight to the resolver without passing by the middleware first.
I made sure that the middleware is working as when i apply the middleware in the lighthouse config it works perfectly and all the graphql requests pass by the middleware first before being handled by the graphql controller.
This is my schema.graphql:
What could be the problem here?
Thanks a lot for an amazing project btw
The text was updated successfully, but these errors were encountered: