Add a scalar JSON to graphql and use it for the authenticate params type#798
Add a scalar JSON to graphql and use it for the authenticate params type#798
Conversation
TimMikeladze
left a comment
There was a problem hiding this comment.
Code looks good.
Needs some documentation about what the json input needs look like for existing authentication types since the AuthenticateParamsInput is removed.
|
what do you think about using JSON from GraphQL Scalars? |
|
@Urigo I saw that you were using graphql-type-json for graphql-scalars, since it's the only custom scalar we are using, I was thinking to just use it directly :) |
|
@pradel I kinda solved it (prune to overrides) in https://github.com/ozsay/accounts/tree/graphql-api-2. after the change, if I wanted to add a new service (tested for the code-service in PR), I could add it to its The module mechanism would merge Since I'm using the same mechanism as before, I guess it works the same without my changes to |
|
@ozsay I see, I like the idea, my only concern is that every time you add a service you will have to change the graphql schema meaning more configuration to do for the users. |
|
Since we can actually extend the input in graphql 14.X maybe it's better to not use JSON |
|
Extend is the way to go 🚀 |
Related to #796, @ozsay you might want to take a look.
Using a JSON scalar for the params argument will allow us to write more services without having to change the graphql schema to support that specific service