GraphQLAuthorize Attribute
See original GitHub issueIt would be really nice if we could add code like this in our underlying type
[GraphQLAuthorize("my policy")]
public Task<User> GetUser(IResolverContext context) {
}
instead of having to do
protected override void Configure(IObjectTypeDescriptor<Query> descriptor)
{
descriptor.Field(f => f.GetUser(default))
.Authorize("my policy");
}
It would also be nice if this new attribute could be added to the Type itself
[GraphQLAuthorize("my policy")]
public class UserType : ObjectType<Query>{
}
or
[GraphQLAuthorize("my policy")]
public class Query { // <-- or you can add it to the underlying type instead
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Authorization
GraphQL ASP.NET draws from your configured authentication/authorization solution. Execution directives and field resolutions are passed through the libraries ...
Read more >graphql-dotnet/authorization: A toolset for ...
GitHub - graphql-dotnet/authorization: A toolset for authorizing access to graph ... or with AuthorizeAttribute attribute if using Schema + Handler syntax.
Read more >Authorization in GraphQL
Authorization in GraphQL · In this post, we're focusing on authorization · Putting user info on the context · Basic whole-schema authorization.
Read more >How to implement authorization using GraphQL.NET at ...
I am looking for sample code and examples regarding how to implement authorization at resolver function level using GraphQL.NET and ASP.NET CORE ...
Read more >Authorization - Hot Chocolate v12
Authorization allows us to determine a user's permissions within our system. We can for example limit access to resources or only allow ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will move it to the 9.1 backlog and it should be available in about 4 weeks.
Just tried to add the new Authorize attribute by removing what I had which was
unless im assuming too much on where the attribute should work.