This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled Feathers authentication on services for services called in
GraphQL resolver functions. Combined changes for graphql and generator-feathers-plus - Summary: - params.provider, user & authenticated are copied from the graphql service call into the params for every Feathers service call in a resolver of BatchLoader. - If you need additional props to be copied over, include their names in `options.extraAuthProps` and `convertArgsToFeathers`. - For custom resolvers or BatchLoaders, you need to record the `convertArgsToFeathers()` call as explained in the details. - Note you can enable authentication on a Feathers service or graphql only if you've run `generate authentication` first. - Details: - 'content' param in resolver calls now contains provider: params.provider, user: params.user & authenticated: params.authenticated (if any) from the /graphql call. - In `const createdService = createService(options);` options.extraAuthProps can pass an array of additional prop names to be copied from params to content. This allows other auth-related props to be copied into content. - The previous `convertArgsToFeathers(args, ast, {...})` is recoded to `const convertArgs = convertArgsToFeathers([/* prop names */]);` `...` `convertArgs(args, content, ast, {...})` where the `pop names` would normally be the same names used in `options.extraAuthProps`. These are additional props to copy into parms for the Feathers service call being made in the resolver function.
- Loading branch information
Showing
5 changed files
with
72 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters