Skip to content

Auth not working for InputObjectGraphType<> #27

@okarlsson

Description

@okarlsson

I'm having some issues with auth between input and output types. With the following types I only got an error if I tried to use the name field in a query, but not in my mutation.

I'm using GraphQL.Authorization 2.0.27 and it seems like this should have been resolved in #17 ?

public class UserType : ObjectGraphType<User>, IGraphQLType
{
	public UserType()
	{
                Name = "User";
		Field(c => c.Id, type: typeof(IdGraphType)).Description("The id of the user");
	        Field(c => c.Name).Description("The name of the user").AuthorizeWith(AuthPolicies.SuperAdminPolicy.Name);
        }
}
public class UserInputType : InputObjectGraphType<User>, IGraphQLType
	{
		public UserInputType()
		{
			Name = "User";
			Field(c => c.Id, type: typeof(IdGraphType)).Description("The id of the user");
			Field(c => c.Name).Description("The name of the user").AuthorizeWith(AuthPolicies.SuperAdminPolicy.Name);
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions