create-graphql-server
create-graphql-server copied to clipboard
Authorization PR
How would you like to take this forward (i.e. implement the actual code generation?)
The nice thing about the current setup is now we have the generated code we want (modulo a few small changes / formatting etc) we can follow TDD to get the code gen built. Have you looked at the codegen part of CGS yet? I'd be happy to be more involved in this part if we want to merge this PR to a branch and commit directly to that branch?
Can work on the code generator soon, after the npm package for the authorization part.
I'm ok with the branch. Do you create it?
@tobkle bringing this out of the line comments. You said:
Removing it in model/Twitter.js currently has no negative effect on the current test cases.
But if I remove try/catch in the model/User.js, it is getting admin access in some of the cases. Or maybe we have to adjust the underlying queryForRoles -> logger(authlog) instead, which holds the throw on error? Do you have a better idea therefore? I agree the try/catch here isn't nice, but somehow I have to react on this error case, otherwise I'll get admin access.
Hmm, this sounds a little concerning ;)
What is the exact flow that ends up giving admin access if we don't catch the exception? I would have expected it to just kill the whole query?
Did the change. First prototype of the adjusted generator is running. Tests are passing. Except for the yarn.lock on CircleCI. Had it run with npm instead of yarn the last time, as yarn was causing problems in my local environment. Yarn hadn't got any network connect. Haven't had the time yet to solve that. Can you give me some comments about the way the generator is implemented? Reading the AST is not so well done yet. Also the code replacement in the model file, but it was the easiest first approach. I should find some time to continue on the weekend.
Have now two active branches master (this) and another one, where I've integrated both, Authorizations and Query Arguments.
Sorry I am lagging so much on this, crunch time for me right now.
Don't mind. Whenever you have the time. Have learnt a lot on this project so far. Thanks for your work.
Wow, this is looking really amazing