Skip to content
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

Am I doing something wrong? #89

Open
jeffdsu opened this issue Nov 7, 2022 · 1 comment
Open

Am I doing something wrong? #89

jeffdsu opened this issue Nov 7, 2022 · 1 comment

Comments

@jeffdsu
Copy link

jeffdsu commented Nov 7, 2022

I have a code first schema using apollo v4 server. I have sometning like this

currentMarketUser: {
extensions: createAuthZExtensions({
rules: ["IsMarketUserOnly"],
}),
type: internalServices.IAMService.api.graph.types
.CurrentMarketUserType,
resolve: (_, args, context) =>
internalServices.IAMService.api.graph.queries.currentMarketUser(
_,
args,
context
),
},

but it seems the rule never runs. I read the libary code and it seems

const compiledRules = (0, core_1.compileRules)({
document: filteredDocument,
schema: requestContext.schema,
rules,
variables,
directiveName,
authSchemaKey,
authSchema
});

compiledRules rules is empty and i think it because its checking only entities but not the top level query function. Is it supposed to? I feel like i copied the examples pretty closely

thanks for the help!

@vtereshyn
Copy link
Contributor

Hi @jeffdsu

I am incredibly sorry for the late response. If the issue is still relevant, please provide a reproducible repository/sandbox and we will try to help

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants